-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_st.py
More file actions
28 lines (19 loc) · 719 Bytes
/
Copy path_st.py
File metadata and controls
28 lines (19 loc) · 719 Bytes
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
str = "shivprasad"
print(len(str))# len() - Find String Length
print(str.upper())#. upper() & lower() - Change Case
print(str.lower())
print(str.title())
print(str.swapcase())
print(str.strip())# strip() - Remove Whitespace
print(str.lstrip())
print(str.rstrip())
new_text = str.replace("shiv","attitude")#shiv replace with attitudeprasad
print(new_text)# replace() - Replace Substring
text =" apple apple apple "
print(text.replace("apple","orange"))#Apple replace with orange
str1 ="shivprasad is programmer"# split() - Split String into List
words =str1.split()
print(words)
str2 =['shiv','prasad','coder']#join() - Join List into String
sentence =" ".join(str2)
print(sentence)