- 1
What.in the world.is haPPENING
Else statements are really just annoying the hell outta me. Any help is GREAT.
4 Respostas
+ 7
Would appreciate if you provide a sample of what you do not understand about else statements, so that we can help you.
+ 6
Syntax:
if condition :
#code 1
else :
#code 2
If the condition is true, code 1 will be executed. However, if the condition is false, code 2 will execute instead.
So, an else statement is a way of saying 'run this if the if statement is false'.
Try practicing with some numbers to build your understanding.
num = 100
if num < 100:
print("Less than 100")
else :
print("Equal or greater than 100)
Hope that helps xd
+ 1
What language are you working in? Can we get more information on what you need help with?
0
@Rrestoring faith tysm I get it naow omg I’m so stupid