+ 1
Find the errors (There are 2 errors).Assuming words is a valid list of words, the program below tries to print the list in rever
for i in range(len(words),0,-1): print(words[i], end=' ')
3 Antworten
+ 2
List have len(list) - 1 elements
So starting value for range should be len(words)-1
And range don't include last parameter
So second value should be (-1) so to get numbers till 0(index of first element in list)
So right code:
for i in range(len(words)-1,-1,-1):
print(words[i], end=' ')
Hope It Helps You 😊
0
Show your attempt please.