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

Rewrite the sentences using not as ... as and the opposite adjective. 1 My hair is shorter than your hair. 2 English is easier than Chinese. 3. Turkey is hotte
It does not require a majority to prevail, but rather an irate, tireless minority keen to set brush fires in people's minds. -Samuel Adams How did Samuel Adams
What is 12%of 17.5????
3/5x+1/2y=30 please help!
Name three groups that clashed over territory and resources in South Africa
8 (t+2)-3 (t-4)=6 (t-7) 8
In "The Gift of the Magi," why is Della crying at the start of the story? A. She finds out that Jim does not want her to buy him a gift. B. She an
list the seven basic internal components found in a computer tower
How can you make 36 cents
How many frames per second can a half duplex traditional gigabit ethernet handle?