Search for question
Question

Question 2: (file name: prime interval.py) (30 points): Write a program that given two integers a and b, returns a list of all prime numbers greater than or equal to a and less than or equal to b. If no prime numbers are found in the provided interval, then the function should return an empty list. Assume 1 ≤ a ≤ b. Define a function called prime_interval that accepts two integer parameters, a and b. The function should return (NOT print) a list of all the prime numbers as explained above. For instance, if the function is called as prime_interval(30, 50), it should return [31, 37, 41, 43, 47]. Demonstrate its use by printing the result of the example above.

Fig: 1