Skip to content

Latest commit

 

History

History
70 lines (60 loc) · 1.13 KB

gif.md

File metadata and controls

70 lines (60 loc) · 1.13 KB

Length

Code:

a = input ("Enter a String: ")
print ("The length of the string is: ", len(a))

Output:

The length of the string is: 9

Reverser

a = input ("enter the string- ") 14= a [ ::- 1] print("The Reverse of this String is- ",b)

//The Reverse of this String is- uhsnamih

String Length Equality Checker

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

Palindrome

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

SubString in a String

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