-2

I coded this in repl.it but it isn't working. Can anyone tell me why?

import random, sys

mynumber = random.randint(1, 31)
month = 0
print("password cracker 1.0")
username = input("Email: ")
year = input("Year that they were born: ")
while True:
    if month == mynumber and year == 2006:
        print("yes")
        print(month)
        sys.exit(0)
    else:
        print("no")
        month + 1
abdullahalali
  • 396
  • 2
  • 5
  • 18

1 Answers1

0

You need to compare compatible types. Either

int(year) == 2006

or

year == "2006"

The string "2006" returned by input is not equal to the int value 2006.

chepner
  • 497,756
  • 71
  • 530
  • 681