Logical expression practice and the if…else operator
Answers are for parents and teachers.
1
Find the value of (5 > 2) and (7 < 3) or (1 == 1).
True
2
The air temperature t (a whole number) is typed. Write a program that prints “muz” (ice) if t is below 0 and “muz emas” otherwise.
t = int(input()) ⏎ if t < 0: ⏎ print("muz") ⏎ else: ⏎ print("muz emas")
3
Write a single print() that prints True if the typed number is a multiple of 3 and False otherwise.
n = int(input()) ⏎ print(n % 3 == 0)
4
How is the condition written that checks whether a rectangle with sides a and b is a square?
a == b