'Python, condition with a random number

what's wrong with this code? since the guess is 4, and the dice was 4 too, it's supposed to print "Impressive"...... why is it firing the else clouse?

enter image description here



Solution 1:[1]

the return type of input() is str and randint returns int

so basically ur trying to do 4 == '4', which will return False

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ryuga