PYTHON STRING REVERSE

PYTHON STRING REVERSE

def reverse(str):
    revstr=""
    for i in str:
        revstr=i+revstr
    print("reversed string is : ",revstr)

string=input("Enter the string: ")
print("Entered string is: ",string)
reverse(string)

Comments

Popular posts from this blog

SAME NAME IN CLASS METHOD AND CONSTRUCTOR

PALINDROME NUMBER

FIBONACCI SERIES