-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring_method.py
More file actions
40 lines (36 loc) · 816 Bytes
/
string_method.py
File metadata and controls
40 lines (36 loc) · 816 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
34
35
36
37
38
39
40
# s = "peter"
# print(s.capitalize())
# print(s.upper())
# t = "PARKER"
# print(t.lower())
def demo_upper():
choice = input("[M]ale, [F]emale: ")
if choice.upper() == "M":
# if choice == "M" or choice == "m":
print("male")
else:
print("female")
def demo_title():
s = "the land of smiles"
print(s.title())
def demo_split():
s = "the land of smiles"
a = s.split()
print(a)
print(a[1])
t = "thailand,5,7,3"
b = t.split(",")
print(b)
x ="1920x1080"
p = x.split("x")
print(p)
w,h=x.split("x")
print(w, h)
def demo_split_app():
first_name, last_name = input("enter your full name: ").split()
print("first name:", first_name)
print("last name: ", last_name)
# demo_upper()
# demo_title()
# demo_split()
demo_split_app()