how many times following loop will execute.
for x in range (-5):
print(x)
please don't spam army
i will mark you brainlist
Attachments:
Answers
Answered by
2
Answer:
the loop will execute only 1 time.
Answered by
1
The loop will execute 0 times.
Explanation: The range function takes the following parameters:
range(start, stop,end).
for x in range(-5):
print(x)
The given expression will not produce any output.
The given range(-5) will return an empty sequence because there are no numbers, which start from -1 and goes on. Therefore, the loop will not execute due to an empty sequence.
Similar questions