-
Notifications
You must be signed in to change notification settings - Fork 0
/
test_day9.py
103 lines (57 loc) · 1.87 KB
/
test_day9.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
#****************************************************************************************************#
# time:2019.6.17
#test tipoc
#****************************************************************************************************#
tip = '*--------------------------------------------*\r\n'
flag_pizs = True
while flag_pizs:
pizs_buf = input('请输入您想要的披萨配料:')
if pizs_buf == 'quit':
flag_pizs = False
else:
print('我们会在您的披萨中加入' + pizs_buf + '这种配料!')
print(tip)
#****************************************************************************************************#
while True:
num = input('请输入您的年龄:')
if num == 'quit':
break
elif int(num) <= 3:
print('不用钱')
elif int(num) <= 12:
print('10美元')
else:
print('15美元')
print(tip)
#****************************************************************************************************#
sandwich_orders = ['牛肉','猪肉','斋']
finished_sandwiches = []
while sandwich_orders:
sandwich_buf = sandwich_orders.pop()
print(sandwich_buf)
finished_sandwiches.append(sandwich_buf)
print(finished_sandwiches)
sandwich_orders = ['牛肉','五香','猪肉','五香','斋','五香']
print('五香的卖完了')
print(sandwich_orders)
while '五香' in sandwich_orders:
sandwich_orders.remove('五香')
print(sandwich_orders)
print(tip)
#****************************************************************************************************#
user = []
user_info = {}
while True:
name_buf = input('请输入你的名字:')
city_buf = input('请输入你想去城市:')
user_info['name'] = name_buf
user_info['city'] = city_buf
user.append(user_info)
buf = input('继续输入下一个用户(yes/no):')
if buf == 'yes':
continue
elif buf == 'no':
break
print(user)
def str_cty(buf1, buf2):
return buf1 + ' ' + buf2