Reverse a string - Coder's point

Saturday, June 1, 2019

Reverse a string

 
def rev(str): str=str[::-1] return str s = "Coders point" print ("The original string is : ",end="") print (s) print ("The reversed string is : ",end="") print(rev(s))

 OUTPUT:  
 The original string is : Coders point  
 The reversed string is : tniop sredoC  

No comments:

Post a Comment