Plange


returns the expression corresponding to the first parenthetical that evaluates to true when coerced to a boolean, or the else case if none of them evaluate to true, assuming that the else case is present, otherwise returning void

syntax

"if" {IC} PARENTHETICAL {IC} EXPRESSION {{IC} "elif" {IC} PARENTHETICAL {IC} EXPRESSION} [ {IC} "else" {IC} EXPRESSION ]

Example

if (input("What is 1 + 1 ? ") = "2") {
    print("You are correct!");
} else {
    print("Sorry, you are incorrect.");
}

copyright © Brent Lewis 2017