I'm trying to to define a function called inTheFuture() that accepts a given year number, a month number, and a day number as 3 separate arguments. The function should return a Boolean value (True or False) to indicate whether the date (year, month, and day) parameters are in the future or not.
This is the error message I keep getting:
TypeError: float() argument must be a string or a number, not 'tuple'
I have tried converting float, string, int, and I'm just at a loss.
This is my code:
import sys
import datetime
year= input ("Enter Year: ");
month= int(input ("Enter Month: "));
day= int(input ("Enter Day: "));
def getTodaysDate():
return datetime.datetime.today();
today = getTodaysDate();
def inTheFuture():
ymd=(year,month,day)
if float(ymd)>today:
return true
if float(ymd)<today:
return false
inf = inTheFuture();
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…