Can someone properly explain what elif means? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Can someone properly explain what elif means?

I know that it means else if but what does it do??

28th Feb 2019, 5:00 PM
DH1505
DH1505 - avatar
5 Answers
+ 6
if x: code executed only if x is true elif y: code executed only if x is false but y is true else: code executed only if x and y are both false
28th Feb 2019, 5:11 PM
Russ
Russ - avatar
+ 7
// "elif" means "else if" and he is used to create a other condition if it is true. For example : if (condition): # Execute this code if this condition is true elif (condition): # Execute this code if this condition is true else: # Execute this code if this condition is false
28th Feb 2019, 9:20 PM
program
program - avatar
+ 2
Just a Short Version of Else if
28th Feb 2019, 5:05 PM
nobody
+ 1
nobody plz read my full comment๐Ÿ˜‰๐Ÿ˜‚๐Ÿ˜€
28th Feb 2019, 5:23 PM
DH1505
DH1505 - avatar
0
Russ thanks this helped alot russ
28th Feb 2019, 5:22 PM
DH1505
DH1505 - avatar