Write a simple python program to take input from the user and then print it's length and reverse using for loop and len function.
Answers
Answered by
1
Answer:
This program will take a string as an input and does the particulars mentioned on the question.
CODING:
string = input ( " Enter a string : " )
length = len( string )
print ( "Length of the string is : " , length)
reverse_string = ""
for i in range ( -1 , - (length - 1) ) :
reverse_string += string[ i ]
print ( "The reverse of the string is : ", reverse_string)
OUTPUT:
Enter a string : Python
Length of the string is : 6
The reverse of the string is :
Hope it helps !
Similar questions