Question: For Python 3 Write a Python program that prompts the user for an integer (positive). Use a loop to print 1 to the number entered.
For Python 3
Write a Python program that prompts the user for an integer (positive). Use a loop to print 1 to the number entered. The numbers should appear on the same line separated by spaces. On the next line print the sum of the numbers printed on the previous line. Do not use the built-in sum function or a formula. Find the sum using the same loop you use to print the numbers. See the sample runs for clarification. Sample Run1
Enter a positive integer: 1 1 The sum is 1.
Sample Run 2
Enter a positive integer: 13 1 2 3 4 5 6 7 8 9 10 11 12 13 The sum is 91.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
