Program:
print("String--> \"Hello World\"")string='Hello World'
print(" \nlength of the string is",len(string))
print(" \nIndex of W is",string.index("W"))
print(" \nCounting of l in string is",string.count("l"))
print(" \nString[3:7]:",string[3:7])
print(" \nString in Lower case: >",string.lower())
print(" \nString in Upper case: >",string.upper())
Expected O/P:
String--> "Hello World"length of the string is 11
Index of W is 6
Counting of l in string is 3
String[3:7]: lo W
String in Lower case: > hello world
String in Upper case: > HELLO WORLD

0 Comments
Post a Comment