Why is it int is the greater than a? Someone help me! So confuse. | Sololearn: Learn to code for FREE!
0

Why is it int is the greater than a? Someone help me! So confuse.

a = 2018 b = input() if a < int(b): print ("invalid birth date") else: print (str(a - int(b)) + " years")

31st Jan 2019, 10:36 AM
Khalid Sanggoyod
Khalid Sanggoyod - avatar
2 Answers
+ 3
It is only a condition that if input b , which we expect that it is an integer is greater than a which is 2018 then print the specify condition otherwise print else condition.. there is only two conditions given in the code either the number is greater or smaller.
31st Jan 2019, 10:56 AM
Aakash Gupta
Aakash Gupta - avatar
+ 2
I got it! thank you so much 😃
31st Jan 2019, 12:04 PM
Khalid Sanggoyod
Khalid Sanggoyod - avatar