Q. Write a program to read today's data from user. Then display how many days are left in the current month.


You can understand by Watching video :-



Answer :-

a = int(input("Enter the date of today = "))
print("Number of days left = ",30-a) 

Output :-

Enter the date of today = 21
Number of days left =  9

>>> 

Enter the date of today = 15
Number of days left =  15

>>> 

Enter the date of today = 19
Number of days left =  11

>>>

5 Comments

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

  1. some month have 31 days

    ReplyDelete
    Replies
    1. It is basic program. If you want then you have to use coditional statements.

      Delete
    2. Give me that code also which have conditional statements to find left days

      Delete

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post