Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

4 How the market system adjusts to change and promotes progress.

Answered: 1 week ago