Question: Write a function, prime_list_reversed, which takes in two positive integers, x and y and output a list containing all prime numbers within the range
Write a function, prime_list_reversed, which takes in two positive integers, x and y and output a list containing all prime numbers within the range of x and y (both inclusive) and returns this list in reverse order. After you are done with the code, insert a few assert statements that checks whether the input is correct (satisfies the problem conditions). def prime_list_reversed (x, y): Input: the number x and y Output: all prime numbers within (x,y) in reverse order >>> prime_list_reversed (3, 10) [7, 5, 31 >>> prime_list_reversed (3, 3) [3] www # YOUR CODE IS HERE assert # YOUR CODE IS HERE "first argument must be an integer" assert # YOUR CODE IS HERE # "second argument must be an integer" assert YOUR CODE IS HERE "first argument must be positive" assert YOUR CODE IS HERE "second argument must be than the first one"
Step by Step Solution
There are 3 Steps involved in it
Heres the implementation of the primelistreversed function along with the ... View full answer
Get step-by-step solutions from verified subject matter experts
