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" (PARENTHETICAL) (EXPRESSION) {{IC} "elif" (PARENTHETICAL) (EXPRESSION)} [ "else" (EXPRESSION) ]

Example

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

This website does not use cookies or javascript, excluding the Google search bar.
copyright © Brent Lewis 2013-2018