It appears that you want to check if the user’s number contains the same digit as the computer-generated numbers.
If you only ever going to have two digits numbers you can get away with if str(RandomNum) == str(Guess)[::-1]:
. This will check if the string value of RandomNum
is equal to the string value of Guess
in reverse.
If you want a more generalized solution then first you will need to define the desired behavior.
solved Checking 2 int variables