What is else statement ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is else statement ?

1st Jul 2019, 11:41 AM
DEVA SURYA
DEVA SURYA - avatar
5 Answers
+ 2
Else is statement is uses the if or if else statements have value false!
1st Jul 2019, 2:19 PM
CodeFu
CodeFu - avatar
0
It's similar to the if statement, and it cannot exist without it. The code block after it will execute if the condition in the if statement before it is false. Example: x = 5 if x == 4: print("x equals 4") else: print("x doesn't equal 4")
1st Jul 2019, 11:44 AM
Airree
Airree - avatar
0
An statement what executes if "if statement" returns false
1st Jul 2019, 11:45 AM
ΛM!N
ΛM!N - avatar
0
Thanks 😁
1st Jul 2019, 11:46 AM
DEVA SURYA
DEVA SURYA - avatar
0
if condition: here are the orders that are executed if the condition is true and that can occupy multiple lines. else: and here are the orders that are executed if the condition is false and that can also occupy multiple lines.
1st Jul 2019, 11:49 AM
Denis Omar
Denis Omar - avatar