1. Write a function that takes in a list and returns a new list that has the elements of the parameter in reverse order 2. Write a function to return the index of the maximum element in a list 3. Write a function that takes in a list returns a new list with only the odd elements from the parameter list. 4. Write a function that takes in two lists. Each parameter represents a point, e.g., [1,1]. Return the Euclidean distance between the two points.
Q: Write and test a function shuffle (my List ) that scrambles a list into arandom order, like…
A: Given: Write and test a function shuffle (my List ) that scrambles a list into arandom order, like…
Q: Please answer in Python 1) Write a function towards which takes as an argument a list li…
A: The solution to the given problem is below. ***Note: According to Bartleby policy we are not…
Q: Write a function called get_palindromes () that takes a list of words as input. The function should…
A: Please refer below commented code and output screenshot: def get_palindromes(list_word):…
Q: Write a function find_plateaus that receives a list of integers as parameters. Your function should…
A: A Python program is as follows, File name: “main.py” #Define a function that find and return a list…
Q: Please answer it in Python Write a function min_odd that takes a list as an argument and returns…
A: The python codes are given below
Q: Write a function that will accept an empty list then populate it with 100 integer test scores from…
A: Python is an interpreted program, object-oriented language, high-level programming language with…
Q: Use Standard ML Code: Write a function that returns the factorial of a number. Write a function…
A: The above question is solved in step 2:-
Q: Write a function print_less() which • takes an integer, x and a list on integers, a list as…
A: Iterate over given a_list and then check each number in the list whether it is lesser than x or not…
Q: Exercise 3: Single parameter Write a function print_even() which • takes a list of integer numbers…
A: A number is said to be an even number if the number is divisible by 2 and the remainder of the…
Q: Write a function that takes a list removal(L), delete from it all the elements whose indices are…
A: Algorithm: Start Initialize a list with given data Define a method named removal which takes the…
Q: Write a function truecount in SML of type bool ist -> int that takes a list of boolean values and…
A: We need to write a function truecount in SML of type bool ist -> int that takes a list of boolean…
Q: Define a function below called make_list_from_args, which takes three numerical arguments. Complete…
A: Note:- You have not mention the language of the program, So I am doing your question in Python. Your…
Q: write a function called get_pa S that takes a list of words as input. The unction should return a…
A: Here is the code in Python:
Q: Write a function that takes a list as a parameter. The list will contain a mixture of integers and…
A: Rawcode: #asking user to enter list elements elements = input("Enter the list elements: ")…
Q: Write a function that takes two arguments, a list L1 and a list L2. • If the length of the list L1…
A: l=list(map(int,input().split()))m=list(map(int,input().split())) li=[]if len(l)>2*len(m):…
Q: Write a function string to_list that takes a sequence of integer numbers as a string the examples…
A: GIVEN: Create a python program with function string_to_list that converts the string with a sequence…
Q: Write a function MedianWithoutHL(ScoreList) that takes an unsorted list of n numbers as a parameter,…
A: Explanation Step by step algorithm create an array of double and fill the array with user…
Q: Write a function called `filler(A, 1) that takes an integer A, and a list of integers 1 and if some…
A: so the function in python is:- def filler(A,l,summ=None): if len(l)==0: if…
Q: Write a function named vectorSum(11, 12) that takes two lists of numbers and adds the numbers in 12…
A:
Q: 3. Define a function in Python that takes a list as the parameter and returns True if the list…
A: Define a function in Python that takes a list as the parameter and returns True if the list contains…
Q: 14. Suppose we have an integer list that contains quiz scores in which a score can range from 0 thru…
A: Python used to answer this question
Q: unction will return a list of numbers whose elements are Ax^2, where x is an element of the inputed…
A: According to the Question below the Solution: Output:
Q: Write a function that accepts two lists as it's only arguments. The function should return a new…
A: PYTHON code for above : # required function for above def func(list1, list2): list3 = list1…
Q: Write a function is Prime (a_nNum) that takes a positive integer as an argument and returns True if…
A: Here is the python code. See below step for code and output:
Q: Write a function called 'filler (A, 1) that takes an integer A, and a list of integers '1 and if…
A: Hey there, I am writing the required solution of the above stated question.Please do find the…
Q: Write a function that will accept a list of integers and return the sum of the contents of the…
A:
Q: Write a function inde which returns the index (start from 1) of the occurrence of a given value. Use…
A: NOTE - I have used the Python programing language. As per our guidelines, we are supposed to answer…
Q: Write a function that accepts a number and a string as arguments. It should return a list having n…
A: We need to write a function that accepts two parameters- a number a string The function will…
Q: Please answer it in Python Write a function last_consonant that takes as an argument a word and…
A: Q: Code the given function in python
Q: .. Write a function that takes in a list and returns a new list that has the elements of the…
A: As per guidelines, we are supposed to answer only one question. Kindly repost the other question as…
Q: Write a function that accepts two arguments, a list and a number n. The list contains numbers. The…
A: here in this question we have asked to write a program which take a list and an integer input from…
Q: (2) Now implement a convert_words() function, which has a list of words as a parameter, and returns…
A: In this following are the variables, functions, and formulae are used to calculate and display the…
Q: Write a function count_evens(nums) that takes a list of ints called nums and returns the number of…
A: NOTE - I have used python programing language to solve the question. Here I have defined the…
Q: True or false? When a list is passed to a function, a new list is created and passed to the…
A: List List is used to store the multiple items in the single variable. Items in list are changeable,…
Q: Write a function that takes in 2 lists and checks whether they have the same elements in the same…
A:
Q: Write a function sumLength() that takes a list of strings as parameter, finds and returns the total…
A: A list is a collection that holds multiple data items using one variable. The values of the list can…
Q: Write a function called get_palindromes() that takes a list of words as input. The function should…
A: Here is python code for implementation of the question. See below steps for desired output.
Q: 14. Suppose we have an integer list that contains quiz scores in which a score can range from 0 thru…
A: Required:
Q: Write a function sum67 that takes a list as an input parameter and returns the sum of the numbers in…
A: Below is the code in python and sample output:
Q: Write a function "isPrimeList" that takes a list "1" and prints all of the prime numbers in this…
A: def isPrimeList(l): #sorting the list l.sort() print("The prime numbers are ",end='')…
Q: Write a function flat_list() which takes a list that contains unknown number of lists. This function…
A: In the following python code , we need to perform the following operations : Define the python…
Q: Write a function in Ocaml oddfirst : int list -> int list = that takes a int list and returns the…
A: According to the question , we have to Write a function in Ocaml oddfirst. That takes a int list and…
Q: this code should be in python: write a function that receives a list as its only parameter. Inside…
A: Introduction: this code should be in python: write a function that receives a list as its only…
Q: Write a function called `filler(A, l)` that takes an integer `A`, and a list of integers `l` and…
A: Code: #import combinations from itertools from itertools import combinations #function called filler…
Q: Write a function that takes a list of tuples as its only argument, where each tuple contains three…
A: In this question we have to write a python code including list and tuples
Q: should be in python: write a function that receives a list as its only parameter. Inside the…
A: 1. Create a list 2. Making a function remove_duplicates_list(duplist) to remove the duplicate…
Q: Write a function called chop that takes a list, modifies it by removing the first and last elements,…
A: We will be seeing the simple program for implementing our classes. We will be having comments which…
Q: Write a function that takes two lists as input, a list L1 containing characters and a list L2…
A: I have provided PYTHON CODE along with CODE SCREENSHOT and OUTPUT SCREENSHOT------------
Q: 1) - Write a Python function that will receive a list as an argument. A) The function will…
A: Given: 1) - Write a Python function that will receive a list as an argument. A) The function will…
python
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images
- Write python code 1) Write a function verifsort that accepts a list as a parameter, check if the list elements are sorted and returns: 1 - if the list is sorted in ascending order, 2 – if the list is sorted in descending order, and 0 – if the list is not sorted.Can I get some help writing this? Write a Python program that counts the number of words in a list that have a minimum length. The list and the minimum length will be entered by the user. Your program should contain one function: (1) min_len_count(word_list, min_length): This function takes in two parameters, a word_list as a list of words and min_length as the minimum word length (integer). This function will loop over the list elements and return the total number of words in the list that have a length greater than or equal to min_length. Hint: This function should not contain any print statement. (2) Outside the function, your program should do the following: a. Prompt the user to enter 4 string elements and add them to a list called word_list. (Use a for loop) b. Prompt the user to enter an integer value called min_length. c. Call the function min_len_count(word_list, min_length) with two arguments: word_list, min_length d. Print the output that the function returns.Please answer it in Python Write a function min_odd that takes a list as an argument and returns the smallest even integer contained in the list. If the list contains no even integers, the function will return None. For Example : min_odd([45, 62, 19, 22, 26, 18, 3, 5, 14])Expected answer is 14 min_odd([])Expected answer is None Write a function index_of that takes as an argument an integer (supposedly even) and a list, and returns the index to which this integer appears in the list. If the integer does not appear, the function will return None. It is assumed here for simplicity that the integer searched for does not appear several times in the list. Hint: if the for e in list loop doesn't suit you, remember that you can make a for + range or a while. .. For Example: index_of(34, [3, 67, 62, 34, 19, 24])Expected answer is 3 index_of(16, [2, 6, 104, 5, 25, 18, 50, 16])Expected answer is 7
- 1) - Write a Python function that will receive a list as an argument. A) The function will receive a list of at least 5 numbers as a single argument when the function is called. B)The function will ask the user to input a number and will find and return the index of that number in the list. C). If the number is not an element of the list, the function returns the string "unknown" and asks the user to try again. There can be a total of 3 possible failed trials, after which the program will return a message to the user and exit. Choose your own exit message.-python- Write a function called get_words that takes a list of words and a letter,and returns a new list, which only contains the words that don't have the given letter in them. For example, get_words(["cat", "dog"], 'o') should return ["cat"] and get_words(["cat", "bat"], 'a') should return an empty list.Please answer it in Python Write a function somme_even that takes a list as an argument and returns the sum of the even numbers contained in the list. Example: somme_even([4, 7, 12, 0, 21, 5]) return => 16 (because 16=4+12+0). Write a function nb_elem_even that takes a list as an argument and returns the number of even integers contained in the list. Example: nb_elem_even([4, 7, 12, 0, 21, 5]) return => 3 (because 4, 12, and 0 are even). Write a function max_pair that takes a list as an argument and returns the largest even integer contained in the list. It will be assumed for simplicity (in this question only) that the list always contains at least one even number. Example: max_even([4, 7, 12, 0, 21, 5]) return => 12.
- For Python. Write a function find_plateaus that receives a list of integers as parameters.Your function should find and return a list of plateaus, which are numbers that are equal to both of its neighbors. IMPORTANT NOTES: the first and last values can not be plateaus; the plateaus should be in the order they appear in the original list; the same value might be a plateau in multiple places in the original list; there might be no plateaus, in which case you should simply return an empty list. Example 1:If the function call is: find_plateaus([1, 2, 2, 2, 1]) You should return [2], because: 2 == 2 and 2 == 2. Example 2:If the function call is: find_plateaus([10, 2, 20, 4, 4, 4, 5, 8, 5, 5, 5, 5]) You should return [4, 5, 5], because: 4 == 4 and 4 == 4; 5 == 5 and 5 == 5; 5 == 5 and 5 == 5Please answer it in Python Write a decale function that takes as an argument a list l and a number d and returns the list obtained from l by adding an offset of d to each element of l. Example: decale([4, 17, 12], 3) is [7, 20, 15]. Write a function intercale_zeros that takes as an argument a list l and returns the list obtained from l by inserting a zero after each element of l. Example: intercale_zeros([4, 17, 12]) is [4, 0, 17, 0, 12, 0].1 - Write a Python function that will do the following: 1. Ask the user to input an integer that will be appended to a list that was originally empty. This will be done 5 times, meaning that when the input is complete, the list will have five elements (all integers). a. Determine whether each element is an even number or an odd number b. Return a list of five string elements "odd" and "even" that map the indexes of the elements of the input list, according to whether these elements are even or odd numbers.For example: if the input sequence is 12, 13, 21, 51, and 30, the function will return the list ["even", "odd", "odd", "odd", "even"].
- Write a python code that returns the maximum and minimum value in a list using recursion functions.1. Write a function that finds the maximum value in a list of numbers. The maximum value in a list is either the first number or the biggest of the remaining numbers. 2. Write a function that finds the minimum value in a list of numbers. The minimum value in a list is either the first number or the biggest of the remaining numbers. The minimum expectation is that you test your code for the following examples. You could get the list from the user or hard coded in your program.List1={3,4,50,23,45 }List2={12, 65,21, 34, 88}Write a function randomList() that gets three integers as parameters, start, bound, and k. This function will create a list of k randomly generated integer numbers between the start and bound values (both inclusive), and return the created list. Write a function sqrtList() that gets a list as a parameter, print the numbers in the list and their square root. The square roots will be printed with 3 decimal digits. Write Python statements that ask the user to input start, bound and k values, then call the method to perform the calculations and produce the output. At the end print average of numbers by calling the function calculateAverage()./ In python / def get_new_grades():"""Write a function get_new_grades, such that given a string of grades as an input parameter,returns two objects:the initial grades as a list of numerical valuesas well asa new list with the numerical values, where the scores that are less than 50 are replaced by 50. """ pass