def manualReverse(list):
return list[::-1]
def reverse(list):
return list(reversed(list))
list = [2,3,5,7,9]
print manualReverse(list)
print reverse(list)
I just started learning Python. Can anyone help me with the below questions?
1.How come list[::-1] returns the reversed list?
2.Why does the second function throw me NameError: name 'reverse' is not defined?