161k views
2 votes
Write a for loop that prints the integers 0 through 39, separated by spaces.

1 Answer

4 votes

Let's see


\tt for\:i\:in\:range(0,40):


\quad\tt print(i,end='')

  • The loop will run till 39
  • The integers get printed one by one
  • As end space is there they will be separated by space
User Conectionist
by
6.8k points