+ 1
another one question🐥
can I write several "if" conditions in a row, without "else"? For example: if (a[i] < j): j = a[i] if (a[i] < s): s = a[i] Or I have to write just like: if (a[i] < j): j = a[i] else: if (a[i] < s): s = a[i]
3 Antworten
+ 6
Also note the difference between if-if-if and if-elif-elif statements.
✔ In if-if-if the program will read all if statements and determines true or false
✔ In if-elif-elif statements the program reads from the first and if it returns true, it will skip rest of the statements or if it is false then the program continues in the same sequence.
+ 3
Ya
You can write that way also it is helpful in some cases
+ 1
Okeh 🍻 thank you