Question
For the next three questions, assume three variables describing a person are declared: age: variable of integer type giving age of a person in years,
For the next three questions, assume three variables describing a person are declared:
age: variable of integer type giving age of a person in years,
city: variable of string type giving the city that person lives in
profession: variable of string type giving the profession of the person. Possible values are either "Engineer", "Manager", "Lawyer" or "Teacher".
In the following three questions, write a Boolean expression in Python that will express the given condition.
E.g. Boolean expression for "An engineer of age between 30 and 35 living in Seattle" is:
profession == "Engineer" and city == "Seattle" and (age >= 30 and age <= 35)
A) Boolean Expression for "A lawyer or a teacher from Portland who is 30 years old" is:
B) Boolean Expression for "An engineer with the age between 40 and 50 who doesn't live in Boston" is:
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