-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path07_strings.py
More file actions
76 lines (61 loc) · 1.12 KB
/
Copy path07_strings.py
File metadata and controls
76 lines (61 loc) · 1.12 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
'''
collectings of characters
'''
a='operations'
b="python"
c='''java'''
print(type(a),type(b),type(c))
'''
lower
upper
ends with
starts with
replace
Strip
Rstrip
Lstrip
find
index
remove prefix
remove suffix
split
'''
#examples UPPERCASE()
Sravya="job searching"
print(Sravya.upper())
#LOWER CASE()
python="PROGRAMMING"
print(python.lower())
#endsWith()
java="high level"
print(java.endswith("level"))
#startsWith()
java="high level"
print(java.startswith("high"))
#replace with()
genai="Artificial intelligence"
print(genai.replace("Artificial","human"))
#index
java="high level"
print(java.index("level"))
#find
genai="human intelligence"
print(genai.find("human"))
#count
sql="tables coloumns"
print(sql.count("s"))
#remove prefix
AI="chatgpt"
print(AI.removeprefix("chat"))
#remove suffix
input="output"
print(input.removesuffix("put"))
#split (it will change in list format)
genai="HUMAN INTELLIGENCE"
print(genai.split())
#strip
sql=" tables coloumns"
print(len(sql))
database=" tables coloumns"
print(database.lstrip())
print(len(database))