Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

reverse the order of list elements

# create a list of prime numbers
prime_numbers = [2, 3, 5, 7]

# reverse the order of list elements
prime_numbers.reverse()


print('Reversed List:', prime_numbers)

# Output: Reversed List: [7, 5, 3, 2]
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #reverse #order #list #elements
ADD COMMENT
Topic
Name
9+7 =