We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Unless statements are used to conditionally execute a block of code
unless condition { // ... }
unless(condition){ // ... }
unless condition, // ...
unless condition // ...
unless(condition) // ...
unless(condition), // ...
If the condition is false, then the code inside the block will be executed
false
If the condition is true, then other code can be executed instead by specifying an else block
true
else
else { // ... }
} else { // ... }
else // ...
unless is the negated version of the if statement
unless
if
import basics func main { age int = scanInt("How old are you? ") unless age < 18 { print("You are an adult") } else { print("You are a child") } }
Table of Contents