Ad
  • Default User Avatar

    The problem with your code is when it takes input, b is always string(if you give input as 12, it will store as '12' in b it's a string always). So first you need to convert b into int and then make a boolean condition on it's data type.

    Here is the correct code for you.

    from datetime import datetime
    a = datetime.now()
    c = str(a.hour) + str(a.minute)
    b = input("Please, print the password here (without letters!):")
    try:
    if type(int(b)) is int:
    if(b == c):
    print("ACCESS CONFIRMED")
    else:
    print("ACCESS DENIED")

    except:
    print("Please, don't print letters.")
    print("Reset the program.")

  • Custom User Avatar

    Not a suggestion.

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution