Computer Science
Construct a logical expression to represent each of the following conditions:
(a) Mark is greater than or equal to 100 but less than 70.
(b) Num is between 0 and 5 but not equal to 2.
(c) Answer is either 'N' OR 'n'.
(d) Age is greater than or equal to 18 and gender is male.
(e) City is either 'Kolkata' or 'Mumbai'.
Python Control Flow
1 Like
Answer
(a) (marks >= 100) and (marks < 70)
(b) (num > 0) and (num < 5) and (num != 2)
(c) (answer == 'N') or (answer == 'n')
(d) (age >= 18) and (gender == 'male')
(e) (city == 'Kolkata') or (city == 'Mumbai')
Answered By
1 Like
Related Questions
What is nested loop? Explain with example.
What is the significance of updating loop control variable in while statements?
Find error in the following code (if any) and correct it by rewriting the code and underline the corrections:
code=input ("Enter season code : ") if code=w: print "winter season" elif code==r: PRINT "rainy season" else: Print "summer season"
Write the output of the following:
for i in '123': print("guru99",i,)