Answer to Question #4063 in Python for Cameron
timetillnext=(dont know what goes here)
bday=raw_input("What day were you born?: ")
bmonth=raw_input("And the month?: ")
byear=raw_input("And what about the year?: ")
if byear <= "1990":
if bmonth <="May"
print ("Wow your already")+byear
print("And only %time in years, months, and days% untill you are %next year older%")
How do I make the program know the current time, so it can give a
print("wow you have only" %yearstill%, %monthstill%, %daystill% "till you are" %currentage%+1)
now = datetime.datetime.now()
print "Current date and time using str method of datetime object:"
print "Current date and time using instance attributes:"
print "Current year: %d" % now.year
print "Current month: %d" % now.month
print "Current day: %d" % now.day
print "Current hour: %d" % now.hour
print "Current minute: %d" % now.minute
print "Current second: %d" % now.second
print "Current microsecond: %d" % now.microsecond
print "Current date and time using strftime:"
print now.strftime("%Y-%m-%d %H:%M")
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!