167k views
0 votes
(On Python/ Edhesive) Test if a date is a payday based on the day of the month (15th or the 30th).

Sample Run
Enter today's day numerically: 17
Sorry, not a payday.
Enter today's day numerically: 30
It's payday!

1 Answer

1 vote

Answer:

day = input("Enter today's day numerically: ")

if "15" in day or "30" in day:

print("It's payday!")

else:

print("Sorry, not a payday.")

Step-by-step explanation:

Ask the user what day it is and store it in a variable called, day. Write a simple if else statement to check if ut is payday or not. This program can be more advanced by having payday be a variable.

User Webaholik
by
5.0k points