+ 2
how do i use the elif function
like after doing a conditional statement with if and i wan to follow up with another condition
9 Respostas
+ 2
It is explained in "Control Flow" -> "else Statement"
Continue with the tutorial if you haven't got to that chapter ...
+ 2
Elif in conditional statement is same as else if statement ...we use them if we want to test the condition more than ones ...it is used in python to shorten the else if to elif....that is it for me
+ 1
Hello, please try to figure this out yourself, this is by far the easiest and most common programming concept in existence.
+ 1
Please always tag the language you're asking about.
https://code.sololearn.com/W3uiji9X28C1/?ref=app
+ 1
if
elif
else
+ 1
elif is used when u have more than two statment, lets imagine u have three paths ways and u have to choose between those three, and each path way has its own results
ex.
number = 1
if number == 1:
print(“one”)
elif number == 2:
print(“two”)
else:
print(“rest of the number”)
as u could notice there where 3 different path ways and the computer will choose according to the staments.
if number is equal to 1 it will return one and if number is 2 it will return two and if number is any other number beside this two it will reuturn rest of the numbers…
I wish u understood😅
0
pls help
0
Elif goes after if statement and before the else. It's used if you have another condition that you need to check (if it's not this, then check that, then that)
0
Is it for python?