The program prints today's date and the date 5 days from now. First, the datetime module is imported. Then, today's date is obtained using the datetime.date.today() function and stored in the dt variable. Next, a new date object is created using the current date plus 5 days by adding a datetime.timedelta object with days=5 to dt, and this new date is stored in the nd variable. Finally, the program prints the dt and nd variables, which represent today's date and the date 5 days from now, respectively.
import datetime dt = datetime.date.today() nd = dt+datetime.timedelta(days=5) print(dt) print(nd)
2022-09-24 2022-09-29
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions