-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring_methods.py
More file actions
33 lines (22 loc) · 794 Bytes
/
string_methods.py
File metadata and controls
33 lines (22 loc) · 794 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
29
30
31
32
33
# #Upper() function - make our string upper case
print("upper function".upper())
# #Lower() function - make our string lower case
print("LOWER FUNCTION".lower())
# #capitalize() func capitalize the first letter of our string
print("capitalize function".capitalize())
# #count() func return number of time 'l' apperts
print("hello".count("l"))
#find() func
print("Hello word".find("o"))
#find() func - find o and replace it with X
print("Hello word".replace("o", "X"))
#strip() func - remove any spaces at the begiinig/end
print(" Hello ".strip())
#Activity 2
print("Software Engineering Bootcamp"[5])
#Activity 2clear
print("Software Engineering Bootcamp"[0])
#Activity 2
print("Software Engineering Bootcamp"[-1])
#Activity 3
print("Everyone should learn to code!"[7].upper())