This code will not run as-is. Figure out what "true/false-question" you would put between the
if and
then words to
check if
ans (the number typed at the keyboard) is equal to the answer of
a+b.
Note: the
tonumber( ) function wrapped around the
input() function is needed to convert what is typed at the keyboard
into a numeric form, so it'll work with the comparison operator
==.
If you figure this, can you then figure out how to add another
if statement
using the
~= ($\ne$) operator to display
**wrong** if the user types the wrong answer?