Code:
a = input ("Enter a String: ")
print ("The length of the string is: ", len(a))
Output:
The length of the string is: 9
a = input ("enter the string- ") 14= a [ ::- 1] print("The Reverse of this String is- ",b)
//The Reverse of this String is- uhsnamih
Code:
a = input ("enter the string-")
b = input ("enter the string-")
la = len (a)
1b = len (b)
if len(a) == len (b):
print ("Length of this strings are Equal")
else:
print ("Length of this strings are not Equal")
Output:
length of this strings are Equal
Code:
a = input ("enter the string- ")
b = a[ ::- 1]
ifa=b :
print ("This String is a Palindrome")
else:
print ("This is Not a Palindrome")
Output:
This String is a Palindrome
Code:
a = input ("Enter The Main String")
b = input ("Enter The Sub-String- ")
c = a .find(b, 0, len(a) )
if (c != 1):
print ("This Sub-String Exist in String")
else:
print ("This Sub-String does not Exist in String")
Output:
This Sub-String does notdoes not Exist in String