0

I am experimenting with Python, and I'm currently making a little code type thing. It randomly spits out a five digit code, and asks you for it.

import random
Code = random.randint() #random digits
print("Your Code is ", Code)

And I started working on an if statement to clarify if the code is correct.

A = input("Please enter your code: ")
if A == Code: #problem here
    print("Correct!")
else:
    print("Fail!")

I just don't know how to make the variable itself, if that makes sense, the statement.

Sorry if this was confusing, I am quite new to this and don't exactly know how to explain things...

0 Answers0