write a program that lists all of the Using your is_prime function primes from 2 up...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
Define vulnerabilities, threat and exploits as it relates to information security. Describe two different types of threat actors. Explain the motivation behind the attacks of the threat actors that...
-
During a semester, a class of n=50 students took two exams: a midterm and a final. The mean score for the midterm exam is 80 points with the standard deviation of 6 points. The mean score for the...
-
Order the planning methodsor strategiesthat would be suitable for implementing technology within an organization. (a) Discuss contingencies to take risks into account (b) Define the...
-
Hemming Co. reported the following current year purchases and sales for its only product. Required Hemming uses a perpetual inventory system. Determine the costs assigned to ending inventory and to...
-
For the frame and loading shown, determine the components of all forces acting on member ABE. -3.6 m- 2.7 m 3.6 kN 2.7 m 15 m 4.8 m
-
A major retailer promises 2 day shipping for certain online orders. A consumer advocacy group believes that the shipping times are longer at a significance level of 0.05, and checks a randomly chosen...
-
It has been reported that 30 percent of all couples who adopt a child because of troubles conceiving a child eventually do conceive a child after the adoption, suggesting that adoption makes...
-
Income statements of M Cop. and K Co. for the year ended December 31, Year 6, are presented below: Additional Information ¢ M Co. uses the equity method to account for its investment in K Co....
-
Applying Market Research 1. Research an article/website related to how a given company is applying marketing research and/or results of a recent study (no more than 3 years old). 2. Provide a summary...
-
Identify the errors in the following multiple-step income statement: Armortec Company Income Statement For the Year Ended December 31, 2015 Revenue from sales Sales Add: Sales returns and allowances...
-
On January 1, 20X1, Porta Corporation purchased Swick Company's net assets and assigned goodwill of $82,500 to Reporting Division K. The following assets and liabilities are assigned to Reporting...
-
A function is defined as f(x) = 4+ 4*+5. Evaluate f(-2).
-
What modalities can be employed to engender a culture of constructive feedback and iterative refinement within team environments, wherein the process of collective learning is cherished as an...
-
A taxpayer has $5,000 in investment expenses connected to portfolio income and is in the 8% tax bracket. Assuming the taxpayer itemizes their California return, and that these expenses are the only...
-
How can the cultivation of emotional intelligence competencies within team members serve as a linchpin for the cultivation of interpersonal efficacy and conflict resolution proficiency, thereby...
-
How might the implementation of interdisciplinary frameworks and cognitive diversity enrichment techniques serve as catalysts for the cultivation of a milieu conducive to harmonious team dynamics,...
-
Starbucks currently makes 32789 coffee a year. Starbucks manufactures all of the components. However, Starbucks is considering if it should buy the coffee cups from a supplier. Direct materials: $...
-
Find the center of mass of a thin triangular plate bounded by the y-axis and the lines y = x and y = 2 - x if (x, y) = 6x + 3y + 3.
-
Write a program that copies one file to another. Have the program take the filenames from the command line. Have the program report if it cannot open a file.
-
Write a function that takes three arguments: a pointer to the first element of a range in an array, a pointer to the element following the end of a range in an array, and an int value. Have the...
-
Modify Listing 16.9 (vect3.cpp) as follows: Heres a sample run of the program in Listing 16.9: Enter book title (quit to quit): The Cat Who Can Teach You Weight Loss Enter book rating: 8 Enter book...
-
What is the relation between degrees Fahrenheit and degrees Rankine? And the relation between degrees Celsius and Kelvin?
-
State Newton's second law as you would apply it to a control mass.
-
Define a 1-pound force in terms of the acceleration it will give to a 1-pound mass. Give a similar definition for a newton in the SI system.
Human Resources Management The Guidebook For Design Firms 1st Edition - ISBN: 0471633747 - Free Book
Study smarter with the SolutionInn App