3.3 Code Practice: Question 1
Instructions

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!

please help in python!

Answer :

Answer:

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

if date == 15 :

 print("It's payday!")

elif date == 30 :

 print("It's payday!")

else:

 print("Sorry, not a payday.");

Explanation:

MrRoyal

The program illustrates the use of if-conditions

The program in Python where comments are used to explain each line is as follows:

#This gets integer input for day

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

#This checks if day is 50 or 30

if day == 15 or day == 30:

   #If yes, this prints payday

   print("It's payday!")

#If otherwise

else:

   #If otherwise, this prints not a payday

   print("Sorry, not a payday.")

At the end of the program, the program outputs payday or not a payday; depending on the input from the user

See attachment for sample run

Read more about Python programs at:

https://brainly.com/question/22841107

${teks-lihat-gambar} MrRoyal

Other Questions