#if, else and if else code syntax
Tue Jun 18 2024 21:50:19 GMT+0000 (Coordinated Universal Time)
Saved by
@jkirangw
#if, else and if else
x = 5
if(x==10){
print("X is equal to 10")
}else if(x == 12){
print("X is 12")
}else{
print("x is not any of the above")
}
temp = 80
if (temp > 80){
print("It is hot")
}else{
print("print is not hot outside")
}
votes = 10
if(votes > 50){
print("You won")
}else if(votes < 50 & votes > 40){
print("No winner")
}else{
print("You all failed")
}
content_copyCOPY
https://rdrr.io/snippets/
Comments