Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: Accessing elements from a Python Nested Dictionary 
Python :: update python 2 to 3 
Python :: sorted function in python 3 
Python :: python basics flask project 
Python :: streamlit add chart 
Python :: Find Factors of a Number Using Function 
Python :: get maximum value index after groupby 
Python :: tuple to string python 
Python :: Delete All Rows In Table Django 
Python :: python how to make a png 
Python :: np logical not 
Python :: python test module 
Python :: matplot image axis 
Python :: discord.py create button 
Python :: how to create fastapi 
Python :: adding numbers in python 
Python :: check if variable is none 
Python :: python capitalize 
Python :: char list python 
Python :: remove python 2.7 centos 7 
Python :: How to perform topological sort of a group of jobs, in Python? 
Python :: attributes in python 
Python :: python singleton class 
Python :: server in python 
Python :: generate coordinates python 
Python :: loop through files in a directory python 
Python :: textrank python implementation 
Python :: import sentence transformers 
Python :: remove n characters from string python 
Python :: python strip function 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =