table of Contents
Given the age of the user can guess the age of three
Age guessed, allowing users to select the award twice
Users can select two bonus quit
for i in range(3):
age = range(18, 41)
age_inp = input('请输入你理想的结婚年龄:')
if not age_inp.isdigit():
print('sb')
continue
age_inp_int = int(age_inp)
if age_inp_int > 40:
print('nb')
elif age_inp_int < 18:
print('喂!110吗?这边有变态')
else:
print('恭喜你可以选择以下类型老婆作为你的礼物')
prize={
'0':'青春时尚型',
'1':'贤妻良母型',
'2':'小鸟依人型',
'3':'金刚芭芘型'
}
print('''你有以下选择:
'0':'青春时尚型',
'1':'贤妻良母型',
'2':'小鸟依人型',
'3':'金刚芭芘型'
''')
prize_dic={}
count=2
for j in range(1,3):
prize_inp=input(f'你有{count}次机会,请选择:')
if prize_inp.isdigit():
if prize[prize_inp] in prize_dic:
prize_dic[prize[prize_inp]] += 1
else:
prize_dic[prize[prize_inp]] = 1
else:
if count==1:
break
print('请输入数字')
count-=1
if len(prize_dic.keys())==0:
print('你没老婆了')
elif len(prize_dic.keys())==1:
a=prize_dic.keys()
a=list(a)
print(f'你选择了{a[0]}\n你在想peach呢')
else:
a = prize_dic.keys()
a = list(a)
print(f'你选择了{a[0]}和{a[1]}\n你在想peach呢')
break