Hard time with my Dice game
<p>I have a problem with my dice game. Every time I run it it says incorrect even if I guess the number right. There is the code, and a screenshot of when i got it right: <a href="https://gyazo.com/87400aab5747a05c77415a816952b26d" rel="nofollow">https://gyazo.com/87400aab5747a05c77415a816952b26d</a></p>

<pre><code>import random


ask = input(": ")


for i in range(1):
    dice = random.randint(1, 6)
    print(dice)

if ask == random:
    print("correct")
else:
    print("incorrect")
</code></pre>

<p>That is probably because you read in something which by default will be a type string, and your number is an integer datatype. So "6" won't be equal number 6. You should do some conversion before the comparison if I'm right.</p>

python pycharm