How to use a reverse function in python3?

I want to reverse a string without slicing it but only using reverse function. So how can I use reverse function to reverse a string?

Your Answer

# for string
seqString = 'Python'
print(list(reversed(seqString)))

# for tuple
seqTuple = ('P', 'y', 't', 'h', 'o', 'n')
print(list(reversed(seqTuple)))

# for range
seqRange = range(5, 9)
print(list(reversed(seqRange)))

# for list
seqList = [1, 2, 4, 3, 5]
print(list(reversed(seqList)))

Python

Didn't get the answer.
Contact people of Talent-Python directly by clicking here