Reference no: EM132355237
Question
Having trouble with python coding
For problems 1 and 2: For these problems, by "Boolean Expression" we mean an inequality that Python can evaluate as true or false. E.g. 2 < x <= 4. You could also write the Boolean expression as: x > 2 and x <=4.
1. a. If x and y are both numbers: write the Boolean expression that will state that (x - 2y) is greater than 0 and less than 12.
b. if x = 1 and y = 2, what value would Python assign to the expression you wrote in part a.? Why?
c. if x = 1, y = 2, and z = False, what value will Python return if you type in this expression, and why? z == True and x > 0 or y < 1
d. If x and y are both numbers, write the Boolean expression that states:
i. each is between -1 and 4 inclusive.
ii. one or the other or both is less than or equal to -.5