+ 6
x. reverse()... better it is print(x. reverse) prints the method itself additionally it is an inplaceMethod as Jan Markus already wrote. to create a new object print(reversed(x)).... not sure at alk
9th Apr 2021, 3:42 PM
Oma Falk
Oma Falk - avatar
+ 5
The reverse method needs to be called to do anything. This will work: x=["yg","g","h"] x.reverse() # reverse elements of x. Notice the () brackets. print(x)
9th Apr 2021, 3:43 PM
Josh Greig
Josh Greig - avatar