Question
[EC1-6] ( boolexpr.py ) Write program that defines a boolean function isWithin(m,d,y) , returning True if the date m/d/y falls between the two dates 7/27/1995
[EC1-6] (boolexpr.py) Write program that defines a boolean function isWithin(m,d,y), returning True if the date m/d/y falls between the two dates 7/27/1995 and 7/27/2016, inclusive. Return False otherwise. You can assume that the entered date is valid. Your program should have a main() method that reads three int values month,day,year, then prints out the value of the call to isWithin(month,day,year).
But to earn extra credit, you must write your function WITHOUT using ANY if-elif-else NOR if-else statements, NOR ANY external modules! Do this by writing and returning the value of a single Boolean (bool) expression that is True exactly when the date month/day/year (each variable holding a valid int) satisfies the above requirements. Your function can ONLY use the Boolean and, or, not operators and the comparison operators >, >=, <, <=, ==, !=, plus any needed parentheses.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started