… you will know how to use conditionals in Python.
‚If-Sentences‘ are not only important in the English language but also in the computer language.
With them it is possible to print conditions. Using the following example, which checks whether the given pages are a triangle, I would like to explain the use of ‚if‘ in Python.
In line 7 the basic condition for a triangle is checked first. If this condition is not fulfilled, the program jumps directly to line 14 and it is shown that it is not a triangle.
If the condition is fulfilled, I have a put another nested if-condition. The program then checks whether it is an equilateral triangle.
If this is not the case, but you want to query another condition, use elif.
If the triangle is not isosceles either, it is a normal triangle.