We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents f799884 + f30d46a commit 4563e05Copy full SHA for 4563e05
python-exercises/game_5.py
@@ -1,13 +1,20 @@
1
+from __future__ import print_function
2
import random
3
+
4
+try:
5
+ input = raw_input # Python 2
6
+except NameError:
7
+ pass # Python 3
8
9
min = 1
10
max = 6
11
12
roll_again = "yes"
13
-while roll_again =="yes"orroll_again=="y":
- print"Rolling the dices..."
- print"The values are...."
- printrandom.randint(min, max)
14
+while roll_again in ("yes", "y"):
15
+ print("Rolling the dices...")
16
+ print("The values are....")
17
+ print(random.randint(min, max))
18
19
- roll_again = raw_input("Roll the dices again?")
20
+ roll_again = input("Roll the dices again?").strip().lower()
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments