+ 1

Anyone know why I can't have a countdown?

numbers = list(range(11)) print(numbers) countdown = numbers.reverse() print(countdown)

30th Apr 2018, 5:45 PM
Tyler Stringer
Tyler Stringer - avatar
5 ответов
+ 4
n = list(range(11)) print(n[::-1])
30th Apr 2018, 6:17 PM
Johannes
Johannes - avatar
+ 1
Gordie thanks, I don't quite understand why reverse works like that, but I made a copy of "numbers" and called it "countdown." Then I reversed "countdown."
30th Apr 2018, 5:57 PM
Tyler Stringer
Tyler Stringer - avatar
0
Don't save it in countdown, just do numbers. reverse() and print (numbers)
5th May 2018, 9:18 PM
Jessica Dsouza
Jessica Dsouza - avatar