Ask Question
12 September, 02:02

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!

+4
Answers (1)
  1. 12 September, 04:25
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers