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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mylist.reverse ('0,1,2,3,4,5')
mylist
-------------------------- ---------- ---------- ---------- ---------- ---------
TypeError Traceback (most recent call last)
<ipython-input-9-c1fef7200 f54> in <module>()
----> 1 mylist.reverse('0,1,2,3,4, 5')
2 mylist
TypeError: reverse() takes no arguments (1 given)
mylist
--------------------------
TypeError Traceback (most recent call last)
<ipython-input-9-c1fef7200
----> 1 mylist.reverse('0,1,2,3,4,
2 mylist
TypeError: reverse() takes no arguments (1 given)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes that works! thank you!
Initial poster stated the suggested code worked.
ASKER