asked 31.0k views
0 votes
Write a for loop to print the numbers from 35 to 45, inclusive (this means it should include

both the 35 and 45). The output should all be written out on the same line.
Expected Output
35 36 37 38 39 40 41 42 43 44 45

asked
User NSGod
by
9.0k points

1 Answer

7 votes

Answer:

for num in range(35, 46):

print(num, end=' ')

or

num = 35

while num <= 45:

print(num, end=' ')

num += 1

answered
User Mankarse
by
8.6k points

No related questions found