-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday6(Strings).py
46 lines (36 loc) · 1.14 KB
/
day6(Strings).py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
a="Vishalsingh kashyap!!!!!!!!!!!!" #Srings are immutable
print(len(a))
print(a.upper()) #turns all char into upper case
print(a.lower()) #turns all char into upper case
print(a.rstrip("!")) #removes the symbols the trailing symbols\
print(a.replace("Vishal","Anja"))
print(a.split(" "))
str1 = "Welcome to the Console !!!"
print(str1.endswith("!!!"))
str1 = "Welcome to the Console !!!"
print(str1.endswith("to", 4, 10))
str1 = "He's name is Dan. He is an honest man."
print(str1.find("ishh"))
# print(str1.index("ishh"))
str1 = "WelcomeToTheConsole"
print(str1.isalnum())
str1 = "Welcome"
print(str1.isalpha())
str1 = "hello world"
print(str1.islower())
str1 = "We wish you a Merry Christmas\n"
print(str1.isprintable())
str1 = " " #using Spacebar
print(str1.isspace())
str2 = " " #using Tab
print(str2.isspace())
str1 = "World Health Organization"
print(str1.istitle())
str2 = "To kill a Mocking bird"
print(str2.istitle())
str1 = "Python is a Interpreted Language"
print(str1.startswith("Python"))
str1 = "Python is a Interpreted Language"
print(str1.swapcase())
str1 = "His name is Dan. Dan is an honest man."
print(str1.title())