BrainyBeauty1217 BrainyBeauty1217
  • 20-11-2020
  • Computers and Technology
contestada

(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!

Respuesta :

vfxdead
vfxdead vfxdead
  • 20-11-2020

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.")

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.

Answer Link

Otras preguntas

Explain the error. Jerome tries to find the value of the expression 3-6+5 by first applying the commutative property. He rewrites the expression as 3-5+6. Expla
The best reason why direct democracy would not work well in the United States is that it would be impossible to get each and every citizen to vote. the nationa
A $5000 loan was to be repaid with 8% simple annual interest. A total of $5350 was paid. How long was the loan outstanding?
Because of advances in technology, businesses that were once national are now international?
What do you wrap your sandwich in? (pun, answer must be from the periodic table)
What is 5 divided by 290
How has Washington's environment been affected by human activity
How many solutions does the equation have? 3(4x - 2) = 2(6x - 3) A. one solution B. infinite solutions C. no solution
what two numbers multiply to 120 and add to -26
what two numbers multiply to 120 and add to -26