|
- def lottery_draw():
- candidate = []
- while True:
- # candidate = []
- prompt = '请输入抽奖人员: '
- prompt += '\n结束请输入quit'
- name = input(prompt)
- candidate.append(name)
- if name == 'quit':
- candidate.remove('quit')
- break
- print('截至当前参加抽奖的人员为: ')
- print(candidate)
- for i in candidate:
- print(i, end='\t')
- a = random.choice(candidate)
- print('开奖倒计时',3)
- time.sleep(1)
- print('开奖倒计时',2)
- time.sleep(1)
- print('开奖倒计时',1)
- time.sleep(1)
- image = '''
- /\_)o<
- | \\
- | O . O|
- \_____/
- '''
- print(image)
- print('恭喜'+a+'中奖!')
- lottery_draw()
复制代码 |
|