Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Reversing in Python

# Python3 program to demonstrate the
# use of reverse method
  
# a list of numbers
list1 = [1, 2, 3, 4, 1, 2, 6]
list1.reverse()
print(list1)
 
# a list of characters
list2 = ['a', 'b', 'c', 'd', 'a', 'a']
list2.reverse()
print(list2)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #Reversing #Python
ADD COMMENT
Topic
Name
4+8 =