You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mystborn edited this page Jun 22, 2018
·
2 revisions
An if statement allows you to perform an action if a certain condition is met. An if statement takes the following form:
if(condition)<statement>
If the condition is met, the body is executed. If you want something to happen if the condition isn't met, then you can add an else to end of the if block like so:
if(condition)<statement>else<statement>
For example:
if(i==0)zero=true;elsezero=false;if(name=="Chris"){print("Hello, Chris");}elseif(name=="Bob"){print("Hello, Bob");}else{print("Who are you?");}