Can I use the variables from the instructions in my code?


#1

Question

There are variables defined in the instructions, can I use those in my code?

Answers

Not unless you define them in your code. Any time you use a variable in your code it must be defined before using it.

If you try writing product = fun_multiplication, for example, you’ll receive an error: NameError: name ‘fun_multiplication’ is not defined. Keep that error message in mind for future projects as well.


FAQ: Learn Python - Python Syntax - Arithmetic