Open SK1Y101 opened 3 years ago
Potential for the if-elif-else
block:
Python:
if x == 0:
print("x was zero")
elif x == 2:
print("x was two")
elif x == 7:
print("x was seven")
elif x == 354:
print("x was three hundred and fifty four")
else:
print("x was not any of the numbers listed")
Verboscript could instead make use of a modified version of the else command decided above:
if x is equal to zero, then do the following:
show "x" was zero.
else, if x is equal to two, then do this:
show "x" was two.
if x is instead equal to seven, then do this:
show "x" was seven.
alternatively, if x is equal to three hundred and fifty four, then do this:
show "x" was three hundred and fifty four.
otherwise, do this:
show "x" was not any of the numbers listed.
If statement
A singular if is the simplest branching statement, and decides whether a chunk of code will be executed or not, depending on some condition.
Python:
Verboscript:
Else statement
if the
if
was not true, then theelse
is triggered:Python:
Verboscript:
both
otherwise
andelse
could be applicable.