Computer Science
Write a program to read today's date (only del part) from user. Then display how many days are left in the current month.
Python
Python Funda
98 Likes
Answer
day = int(input("Enter day part of today's date: "))
totalDays = int(input("Enter total number of days in this month: "))
daysLeft = totalDays - day
print(daysLeft, "days are left in current month")
Output
Enter day part of today's date: 16
Enter total number of days in this month: 31
15 days are left in current month
Answered By
45 Likes
Related Questions
Write a program that displays a joke. But display the punchline only when the user presses enter key.
(Hint. You may use input( ))Modify above program so as to print output as 5@10@9.
Write the program with maximum three lines of code and that assigns first 5 multiples of a number to 5 variables and then print them.
Write a program that generates the following output :
5
10
9
Assign value 5 to a variable using assignment operator (=) Multiply it with 2 to generate 10 and subtract 1 to generate 9.