+ 2
Date validator program always showing false result any ideas?
I wrote this script to validate date and it is always showing false even with the correct dates can anybody suggest what's wrong here? https://code.sololearn.com/cSLzUovRv2Vn/?ref=app
3 odpowiedzi
+ 5
def year_check(dd,mm,yyyy):
if yyyy > 2156 or yyyy < 0:
return True
else:
return False
-logical error: replace 'False' and 'True' with each other to correct it.
-what when day is 31 ? you didn't looked into case for it ?
-what about different months having different mumbers of days?
if you made for leap year and february, you can easily make it for rest of the months(use array for simplicity).
+ 1
Gaurav Agrawal Mirielle🐶 [Inactive] thanks got it.