forked from upizpp/PhiScript
-
Notifications
You must be signed in to change notification settings - Fork 0
If else Statements
gene-2012 edited this page Jan 6, 2024
·
1 revision
if (){
<code>
}
else if (){
<code>
}
else{
<code>
}
//If the corresponding code block has only one line, you can omit curly braces
import io;
import os;
var age = io.get_number("What's your age?", "Wrong input! Try again:");
if (age < 0)
io.print("Invalid input!");
else if (age < 18)
io.print("You can't drink!");
else
io.print("You can drink!");
os.system("pause");