112k views
0 votes
Write a loop to print 56 to 70 inclusive (this means it should include both the 56 and 70). The output should all be written out on the same line.

2 Answers

2 votes

Answer:

for i in range(56, 71):

print(i, end=" ")

User JFreeman
by
6.2k points
1 vote

Answer:

for i in range(56,71):

print(i)

Step-by-step explanation:

By the range 56 to 71 it means that for loop will run when i=56 to i=71, but the upper bound is one less than the upper bound, and which is 70. So the above loop will print integers from 56 to 70.

And the above code is in Python.

User Furins
by
5.4k points