r/learnpython • u/Healthy-Departure961 • Sep 07 '26
Regarding question
from datetime import *
year = int(input("Enter the Year:- "))
month = int(input("Enter The Month:- "))
day = int(input("Enter The Day:- "))
x = date(year,month,day)
validity = int(input('Enter the days of validity')) expiry = x + validity print(expiry)
I want to add days in this but i don't know how ,I even tried to adding manually but gives me error unsupported oparand + in datetie.datetime class something
0
Upvotes
View all comments
Show parent comment
1
u/johnpeters42 Sep 07 '26
I mean, yes, but you'll probably get more traction if you explain why "import *" is not just unneeded but actually problematic. (I've probably used it myself, but just for one-off AoC solutions, and I have a rough idea of what the problems would be for production-grade code.)