Python simple dice #21516
-
Why this simple python code always prints “incorrect” ? import random random_number = random.randint(1, 6) while True: else: |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
Read up on raw_input(). It returns a string. |
Beta Was this translation helpful? Give feedback.
-
Is this how to fix it? int(input()) |
Beta Was this translation helpful? Give feedback.
-
The code: import random random_number = random.randint(1, 6) while True: else: The output: |
Beta Was this translation helpful? Give feedback.
-
Found solution, thanks for help import random while True: else: |
Beta Was this translation helpful? Give feedback.
Read up on raw_input(). It returns a string.