Programming Examples

Pythoon program to read todays date only date Part from user Then display how many days are left in the current month


WAP to read todays date (only date Part) from user. Then display how many days are left in the current month.

import datetime
td=0
day=int(input("Enter current date(only date part)"))
now=datetime.datetime.now()
if now.month==2:
    td=28
elif now.month in(1,3,4,7,8,10,12):
    td=31
else:
    td=30
print("Total remaining days in the current month are : ",td-day)
Output

Enter current date(only date part)6

Total remaining days in the current month are :  25

CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz