CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
jackfrued

CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!

GitHub Repository: jackfrued/Python-100-Days
Path: blob/master/Day01-15/code/Day03/rolldice.py
Views: 729
1
"""
2
掷骰子决定做什么事情
3
4
Version: 0.1
5
Author: 骆昊
6
Date: 2018-02-28
7
"""
8
from random import randint
9
10
face = randint(1, 6)
11
if face == 1:
12
result = '唱首歌'
13
elif face == 2:
14
result = '跳个舞'
15
elif face == 3:
16
result = '学狗叫'
17
elif face == 4:
18
result = '做俯卧撑'
19
elif face == 5:
20
result = '念绕口令'
21
else:
22
result = '讲冷笑话'
23
print(result)
24
25