Question: write a program that lists all of the Using your is_prime function primes from 2 up to a user specified limit. Note that your
write a program that lists all of the Using your is_prime function primes from 2 up to a user specified limit. Note that your is_prime function should be reused without any modifications. Test your program with the data in Table 1. Finally, format your program to match the sam- ple output, character for character, including all white space and punctuation. However, note that long lines should not be wrapped match. User input in the sample has been highlighted in Pappy's Purple to distinguish it from the program's output, but your user input does not need to be colored. Save your program as prime_list_login.py, where login is your Purdue login. Then submit it along with a screenshot showing a run of both test cases. Input Limit Output Primes 2, 3, 5, 7, 11, 13, 17, 19, 23, 29 2,3,5,7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101 Table 1: Test data for Exercise 04.5. 30 101 Terminal $ python prime_list_login.py Enter a positive integer: 101 The primes up to 101 are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101
Step by Step Solution
3.45 Rating (148 Votes )
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
