The elif construct in Python

The elif construct allows you to specify an additional comparison before the else block.

Let us have a variable tst:

pythontst = 3

Let's compare its value with the numbers 1 and 5. We'll also write different messages for each of them to output to the console:

pythonif tst == 1:
  print('the num is 1')
elif tst == 5:
  print('the num is 5')
else:
  print('the num is unknown') # will this work
Задание 1

Two variables are given:

pythontst1 = 5
tst2 = 8

Check which of these variables has the greater value and display the appropriate message.

Задание 2

Given a variable age, which contains the user's age. Write a condition when the variable is less than 18 and greater than 10. Then a condition if the number is in the range from 18 to 60. Also write a message to output to the console when the number does not fall into any of the previous conditions.

Задание 3

The variable day contains some number from the interval from 1 to 31. Determine which decade of the month this number falls in (first, second or third).