if a i value is inforior to 5 or superior to 10 in python

To check whether a value is less than 5 or greater than 10 in python, you can use conditional statements. Here's an example:

main.py
i = 7

if i < 5:
    print("i is less than 5")
elif i > 10:
    print("i is greater than 10")
else:
    print("i is between 5 and 10")
135 chars
9 lines

In this example, if the value of i is less than 5, the first condition will be true and the message "i is less than 5" will be printed. If the value of i is not less than 5, the first condition will be false and the second condition (i.e., elif i > 10) will be checked. If this condition is true (i.e., i is greater than 10), the message "i is greater than 10" will be printed. If both the first and second conditions are false (i.e., i is between 5 and 10), the else block will be executed and the message "i is between 5 and 10" will be printed.

gistlibby LogSnag