At the end of this lesson, you will be able to:
understand and use an if ... Else statement
review "Boolean Expressions" and "If ... Then"
in our last if statement assignment, we had to have 2 if statements to catch both sides if the Boolean expression:
this is dangerous (you can make a mistake) and wasteful
a better option is to use an If…Then…Else Statement
if the if is not true, do some other code
nil
click on provided link to create a new GitHub repo
call the repo: TEJ2O.1 ⇢ Unit2-11
create a program that:
on "start", generate 2 random integers from 0 to 99
on button "A", show the 1st number
on button "B", show the 2nd number
on "shake", show either:
1st < 2nd
1st > 2nd
NOTE:Â
I know technically it might choose the same number, we will ignore this case for now!
you MUST use an if ... else statement
do the above assignment but in Python
on "start", generate 2 random integers from 0 to 99
on button "A", show the 1st number
on button "B", show the 2nd number
on "shake", show either:
1st < 2nd
1st > 2nd