If Statement
Simple If Statement
if a > 0 {
print("a > 0")
}
If Else Statement
if a > 0 {
print("a > 0")
}
else {
print("a <= 0")
}
If Else Statement
if a > 0 {
print("a > 0")
}
else if b != 0 {
print("a <= 0 and b != 0")
}
else {
print("a <= 0 and b == 0")
}
If Let Statement
if let Some(a) = a {
print(a)
}
If Let Else Statement
if let Some(a) = a {
print(a)
}
else {
print("a is None")
}