-
Notifications
You must be signed in to change notification settings - Fork 0
/
lab-for-emails-continue.py
179 lines (156 loc) · 6.29 KB
/
lab-for-emails-continue.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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
persons = ["Elizabeth", "steven@sales.mycompany.com", "Sebastian", "Margaret", "svetlana@mycompany.eu", "Raphael"]
domain = "mycompany.com"
emails = []
for person in persons:
if "@" in person:
emails.append(person)
else:
email = person.lower() + "@" + domain
emails.append(email)
for email in emails:
print(email)
print("----------------------")
for person in persons:
if "@" in person:
emails.append(person)
continue
email = person.lower() + "@" + domain
emails.append(email)
for email in emails:
print(email)
'''
exercises
'''
# Twoim zadaniem jest stworzenie fragmentu programu, który wyświetla menu z opcjami do wyboru, a następnie zależnie
# od dokonanego wyboru wykona pewne czynności.
#
# Zadeklaruj zmienne:
#
# menu = '''
# Choose what you want me to do for you:
# 1 - COFFEE
# 2 - TEA
# 3 - MAKE ME SMILE
# ---------------
# To stop this script select 0
# '''
#
# smile = '''
#
# oooo$$$$$$$$$$$$oooo
# oo$$$$$$$$$$$$$$$$$$$$$$$$o
# oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o o$ $$ o$
# o $ oo o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o $$ $$ $$o$
# oo $ $ "$ o$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$o $$$o$$o$
# "$$$$$$o$ o$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$o $$$$$$$$
# $$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$
# $$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$$$$$$ """$$$
# "$$$""""$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$
# $$$ o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$o
# o$$" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$o
# $$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "$$$$$$ooooo$$$$o
# o$$$oooo$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ o$$$$$$$$$$$$$$$$$
# $$$$$$$$"$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$""""""""
# """" $$$$ "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" o$$$
# "$$$o """$$$$$$$$$$$$$$$$$$"$$" $$$
# $$$o "$$""$$$$$$"""" o$$$
# $$$$o o$$$"
# "$$$$o o$$$$$$o"$$$$o o$$$$
# "$$$$$oo ""$$$$o$$$$$o o$$$$""
# ""$$$$$oooo "$$$o$$$$$$$$$"""
# ""$$$$$$$oo $$$$$$$$$$
# """"$$$$$$$$$$$
# $$$$$$$$$$$$
# $$$$$$$$$$"
# "$$$""""
# '''
# Napisz pętlę while, która będzie działać w nieskończoność. W tej pętli:
# wyświetl napis menu z dostępnymi opcjami
# wczytaj do zmiennej letter wybór użytkownika
# napisz polecenie if, które w przypadku, gdy w letter znajduje się 1
# wyświetli informację "Function COFFEE not implemented"
# poprosi o naciśnięcie ENTER
# wróci na początek pętli while
# napisz polecenie if, które w przypadku, gdy w letter znajduje się 2
# wyświetli informację "Function TEA not implemented"
# poprosi o naciśnięcie ENTER
# wróci na początek pętli while
# napisz polecenie if, które w przypadku, gdy w letter znajduje się 3
# wyświetli napis znajdujący się w zmiennej smile
# poprosi o naciśnięcie ENTER
# wróci na początek pętli while
# napisz polecenie if, które w przypadku, gdy w letter znajduje sie 0
# przerwie działanie nieskończonej pętli while
# w każdym pozostałym przypadku wyświetli instrukcję czekając na naciśnięcie ENTER: "You need to make a valid choice.
# Press ENTER and try again!"
menu = '''
Choose what you want me to do for you:
1 - COFFEE
2 - TEA
3 - MAKE ME SMILE
---------------
To stop this script select 0
'''
smile = '''
oooo$$$$$$$$$$$$oooo
oo$$$$$$$$$$$$$$$$$$$$$$$$o
oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o o$ $$ o$
o $ oo o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o $$ $$ $$o$
oo $ $ "$ o$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$o $$$o$$o$
"$$$$$$o$ o$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$o $$$$$$$$
$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$
$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$ $$$$$$$$$$$$$$ """$$$
"$$$""""$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$
$$$ o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ "$$$o
o$$" $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$o
$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" "$$$$$$ooooo$$$$o
o$$$oooo$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ o$$$$$$$$$$$$$$$$$
$$$$$$$$"$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$""""""""
"""" $$$$ "$$$$$$$$$$$$$$$$$$$$$$$$$$$$" o$$$
"$$$o """$$$$$$$$$$$$$$$$$$"$$" $$$
$$$o "$$""$$$$$$"""" o$$$
$$$$o o$$$"
"$$$$o o$$$$$$o"$$$$o o$$$$
"$$$$$oo ""$$$$o$$$$$o o$$$$""
""$$$$$oooo "$$$o$$$$$$$$$"""
""$$$$$$$oo $$$$$$$$$$
""""$$$$$$$$$$$
$$$$$$$$$$$$
$$$$$$$$$$"
"$$$""""
'''
# while True:
# letter = int(input(menu))
#
# if letter == 1:
# print("Function COFFEE not implemented")
# input("press Enter")
# elif letter == 2:
# print("Function TEA not implemented")
# input("press Enter")
# elif letter == 3:
# print(smile)
# input("press Enter")
# elif letter == 0:
# break
# else:
# print("You need to make a valid choice. Press ENTER and try again!")
# input("press Enter")
while True:
print(menu)
letter = input('Enter your choice ')
if letter == '1':
print("Function COFFEE not implemented")
input('Press enter')
continue
if letter == '2':
print("Function TEA not implemented")
input('Press enter')
continue
if letter == '3':
print(smile)
input('Press enter')
continue
if letter == '0':
break
input('You need to make a valid choice. Press ENTER and try again!')