QUESTION IMAGE
Question
- write a for loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50 ... 1000
- write a loop that asks the user to enter a number. the loop should iterate 10 times and keep a running total of the numbers entered.
- write a nested loop that displays 10 rows of # characters. there should be 15 # characters in each row.
Step1: Write for - loop for first problem
for i in range(0, 1001, 10):
print(i)
Step2: Write loop for second problem
total = 0
for _ in range(10):
num = int(input("Enter a number: "))
total += num
print("The running total is:", total)
Step3: Write nested - loop for third problem
for _ in range(10):
print('#' * 15)Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
# Problem 37
for i in range(0, 1001, 10):
print(i)
# Problem 38
total = 0
for _ in range(10):
num = int(input("Enter a number: "))
total += num
print("The running total is:", total)
# Problem 39
for _ in range(10):
print('#' * 15)