Reverse string in python | Syntax for reverse() List Method in Python.

reverse string python

Python – reverse

reverse() method is used to reverse the given list.

Flowchart:-

Syntax for reverse() List Method in Python

list.reverse()

Parameter : There is no parameter for reverse() method.

Returning Value: reverse() method returns ‘None’.

Example for reverse() List Method in Python

list = ["S", "i", "r", "f", "p", "a", "d", "h", "a", "i"]
list.reverse()
print(list)

Output :

['i', 'a', 'h', 'd', 'a', 'p', 'f', 'r', 'i', 's']

Previous articlePython: Print the square and cube symbol in the area of a rectangle and volume of a cylinder
Next articleWhat are Bayesian belief networks? |How does a Bayesian belief network learn?

LEAVE A REPLY

Please enter your comment!
Please enter your name here