-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.py
117 lines (87 loc) · 3.02 KB
/
functions.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
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
def display_message():
print("i am learning about functions")
display_message()
def favorite_book(tittle):
print(f"One of my favorit book is {tittle.title()}")
favorite_book('alice')
def make_shirt(size, text):
print(f"\ni need an {size.title()}")
print(f"\nThe {size.title()} should have a {text.title} message written on it ")
make_shirt('extra large', 'happy birthday')
make_shirt('size', 'i love python')
def describe_city(city, country="germany"):
print (f"{city.title()} is a beautiful city")
print(f"it is found in {country.title()}")
describe_city(city='berlin')
describe_city(city="younde", country="cameroon")
describe_city("los angeles", "america")
def get_formatted_name(first_name, last_name):
full_name = f"{first_name} {last_name}"
return full_name.title()
musician=get_formatted_name('jimi', 'hendrix')
print(musician)
def buld_person(first_name, last_name):
person ={'first': first_name, 'last': last_name}
return person
me = buld_person("Ngwa", "Jude")
print(me)
def get_formateed(first, last):
full_name = f"{first} {last}"
return full_name.title()
while True:
print("\n enter your name: ")
print ("enter 'p' to end")
first =input("first name ")
last = input("last name ")
if first == 'p':
break
if last =='p':
break
def city_country(city , country):
place=f"{city} {country}"
return place.title()
place_1=print(city_country('younde', 'cameroon'))
place_2=print(city_country('new york', 'america'))
place_3=print(city_country('paris', 'france'))
def make_album(artist, album):
musician={'Artist': artist, 'album': album}
return musician
while True:
print("\n print 's' to stop")
artist= input("enter artist name: ")
album =input("enter album: ")
if artist and album == 's':
break
joint=make_album(artist, album)
print(f"{joint}")
def greet_users(names):
for name in names:
msg = print(f"hello {name}")
names=["jude", "Ti", "nivo"]
greet_users(names)
def models(unprinted_designs, completed_designs):
while unprinted_designs:
current_printing=unprinted_designs.pop()
print(current_printing)
completed_designs.append(current_printing)
def completed(completed_designs):
for completed_design in completed_designs:
print("\n These are the completed designs")
print(completed_design)
unprinted_desgns=["phone", "case", "robbot", 'chittin']
completed_desgns=[]
models(unprinted_desgns, completed_desgns)
completed(completed_desgns)
def show_message(greetings,new_greetings):
while greetings:
me=greetings.pop()
new_greetings.append(me)
def send_message(new_greetings):
for new_greeting in new_greetings:
print(f"these are the individual new greetings \n hey {new_greeting} how are u?")
print(new_greetings)
greetings=["vince","drew", "fiene", "dev", "burnley"]
new_greetings=[]
show_message(greetings,new_greetings)
send_message(new_greetings)
print(greetings)