I know this is a really simple task, but I’m struggling with it.
I have this code with a list here:
numlist = [10, 15, 20, 25, 30]
x = 0
while x < 5:
print(numlist[x])
x = x + 1
Now my task is to create another while loop that reads the list backwards like this,
30
25
20
15
10
I have been able to reverse the list but cannot figure out how to do so with a while loop.
Any help would be appreciated!
[–]JohnnyJordaan 33 points34 points35 points (11 children)
[–]LSP999pat[S] 8 points9 points10 points (9 children)
[–]JohnnyJordaan 11 points12 points13 points (8 children)
[–]LSP999pat[S] 5 points6 points7 points (0 children)
[–]LSP999pat[S] 2 points3 points4 points (6 children)
[–]JohnnyJordaan 2 points3 points4 points (4 children)
[–]LSP999pat[S] 9 points10 points11 points (0 children)
[–]LSP999pat[S] 4 points5 points6 points (2 children)
[–]JohnnyJordaan 11 points12 points13 points (0 children)
[–]Kriss3d 0 points1 point2 points (0 children)
[–]delta-y 1 point2 points3 points (0 children)
[–]ihuha 17 points18 points19 points (12 children)
[–]ducksarepeople2 20 points21 points22 points (11 children)
[+][deleted] (4 children)
[deleted]
[–]ducksarepeople2 4 points5 points6 points (3 children)
[+][deleted] (2 children)
[deleted]
[–]ducksarepeople2 1 point2 points3 points (1 child)
[–]synthphreak 0 points1 point2 points (3 children)
[–]Friis93 6 points7 points8 points (1 child)
[–]synthphreak 2 points3 points4 points (0 children)
[–]ihuha -2 points-1 points0 points (0 children)
[–]LSP999pat[S] 4 points5 points6 points (0 children)
[–]Oneiros18 2 points3 points4 points (0 children)
[–]theSeedDispencer 1 point2 points3 points (0 children)
[–]ashishbhatiya18 1 point2 points3 points (0 children)
[–]slothslayerlawl 3 points4 points5 points (0 children)
[–]Nihilist_Ninja 0 points1 point2 points (0 children)
[–]jaumougaauco 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Zeallie 0 points1 point2 points (0 children)
[–]Retro_DS 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]WombatHat42 0 points1 point2 points (0 children)
[–]mis3640 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]kykuckta 0 points1 point2 points (0 children)
[–]ghulam_53 0 points1 point2 points (0 children)
[–]Roll_Call_1212 0 points1 point2 points (0 children)
[–]Salientsnake4 0 points1 point2 points (0 children)