Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Heres the implementation of the primelistreversed function along with the ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started