Ask Question
12 July, 14:53

3.3 Code Practice: Question 1

(Phython coding btw)

Question:

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!

+2
Answers (1)
  1. 12 July, 17:12
    0
    Python Code:

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

    Code Explanation:

    First get date integer value from input by using input () method in python.

    After that check is entered date equals to 15 or 30 then print it's Payday and at the end if user enter other then 15 and 30 the print Sorry, not a PayDay in else clause.

    Code Ouput

    Enter today's day numerically: 15

    it's Payday

    Enter today's day numerically: 17

    Sorry, not a PayDay
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “3.3 Code Practice: Question 1 (Phython coding btw) Question: Test if a date is a payday based on the day of the month (15th or the 30th). ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers