☰ Contents · Computing

If…else practice and the elif operator

Lessons 38–39 · 2 lessons · M. R. Fayziyeva, D. M. Sayfurov, N. S. Xaytullayeva. Informatics and Information Technologies, Grade 9. “Nashriyot uyi Tasvir”, Tashkent, 2020
Answers are for parents and teachers.
1
What does an if…else program for even or odd print for 25 (juft/toq)?
2
Write a program that finds the smaller of two numbers (4 for 9 and 4).
3
Write a program for a typed hour s (0–23) that prints “ertalab” if s < 12, “kun” if s < 18 and “kech” otherwise.
4
Why would the condition m <= 5 be wrong standing alone (as if m <= 5) in the season program?