discret mathematics – NO PLAGIARISM
Web Exercise Direction
September 7, 2019
September 7, 2019
P1: IF AND WHILEDirections. Name your scripts 253-yourlastname-?-?.py . For example, my submission for P3 problem 4 would be a file 253-pauli-3-4.py . Each project script should be uploaded to Canvas by clicking the assignment. The Python Tutorial (PT) is available athttp://docs.python.org/py3k/tutorial/the Non-Programmer’s Tutorial for Python 3 (NP) is available at http://en.wikibooks.org/wiki/Non-Programmer%27s_Tutorial_for_Python_3(1) (PT) Read and work through the examples in §3.1.1. Numbers§3.2 First Steps Towards Programming§4.1 if Statements§4.2. for Statements§4.3. The range() function(2) (NP) Read and work through the examples in • Count to 10• Decisions(3) Write a script that solves the following problems. For each problem, print the problemnumber before the answer to make it easier to grade.(a) Compute the first 20 positive perfect squares using a while loop. (Note: Thisis the same as the square of the first 20 positive integers.)(b) Compute the last digit of each of the first 20 positive perfect squares. You canget the last digit of a using a % 10. As before, use a while loop.(c) Make a conjecture about the digits that can never arise as the last digit of apositive perfect square. Use complete sentences.(d) Verify your conjecture for the first 10,000 positive perfect squares. To avoidhuman error, use a while loop with an if statement that tells you when the conjecture fails. Print the statement Beginning verification… before the while loop and the statement Verification complete. at the end of the while loop. Print Conjecture is false! if you find a counterexample to your conjecture in the while loop. Hint: You can define a set conjectured_set, and check if the last digit is in there.Rubricuse python to program this assignment.
QUALITY: 100% ORIGINAL – NO PLAGIARISM.
- **REMEMBER TO PRECISE PAGE NUMBER**
- Hit The Order Button To Order A **Custom Paper**