Link to home
Start Free TrialLog in
Avatar of Maria Qureshi
Maria Qureshi

asked on

Why is this reverse code wrong?

mylist = []

mylist

mylist.append ('0,1,2,3,4,5')

mylist

and then if I want to reverse it,

mylist.reverse ()
mylist

I don't get an output.
SOLUTION
Avatar of David Favor
David Favor
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Maria Qureshi
Maria Qureshi

ASKER

but I want to reverse my original list.
mylist.reverse ('0,1,2,3,4,5')
mylist
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-9-c1fef7200f54> in <module>()
----> 1 mylist.reverse('0,1,2,3,4,5')
      2 mylist

TypeError: reverse() takes no arguments (1 given)
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes that works! thank you!
Initial poster stated the suggested code worked.