Quick actions

cmd+k|ctrl+k

Navigation

Languages

If,Else, Elif

Snippet info

Language

Python

Visibility

public

Author

hohim4095

Created

2024-09-26T12:33:17.653304Z

Updated

2024-09-26T13:15:28.972716Z

x=1
if x>0:
    print("x is larger than 0")
else:
    print("x is less than 0")
print("this line is out of if block")
y=1
if y==0:
    print("y is larger than 0")
elif y==1:
    print("y is equal to 1")
else:
    print("y is less than 1")
print("y is out of if block")
w=1
if print("w is something"):
    print("w is larger than 0")
elif w==1:
    print("w is equal to 1")
else:
    print("w is less than 1")
print("w is out of if block")
v=0
if v<0:
    print("v is larger than 0")
elif v==1:
    print("v is equal to 1")
else:
    print("v is larger than 1")
print("v is out of if block")
u=-15
if u<0:
  if u<-10:
    print("u is less than -10")
    print("u is less than 0")
elif u==1:
    pass
    print("u is equal to 1")
else:
    print("u is larger than 1")
print("u is out of if block")
INFO