0

Simple Program Not Working

I made this simple program in Python 3 yesterday, but I can't seem to get it to work. x = 69 #Enter the current year for the input y = input() if y < 2018: print("Put in the ACTUAL year, dummkopf.") if y >= 2018: print("69 years from now, it will be the year...") print(int(y) + int(x)) Apparently there's a problem with y, but I can't seem to figure out what it is. Could someone please help me with it?

17th Oct 2018, 5:38 PM
Vadertrooper
Vadertrooper - avatar
2 odpowiedzi
+ 1
The value of y taken is in form of a string, you'll have to convert it into a integer first before adding it with x. Like this y = int(input())
18th Oct 2018, 12:36 AM
Ayushman Sen
Ayushman Sen - avatar
+ 3
you are comparing string with int, convert your input to int first y = int(input())
17th Oct 2018, 5:43 PM
Taste
Taste - avatar