2.9 Programming Page 9
Completion requirements
Creating Variables:
Creating a variable is called declaring a variable. It is done typically at the top of the program. Remember that the variable names are case sensitive. MilesTravelled is not the same as milestravelled.
Note:
- The name of the variable is always on the left, then the =, then the value.
- When listing the variable names inside the print function
you do not use "".
- You must declare a variable before using it.
- You can change the value of a variable after it has been declared. For example, total = total + 1
Comments:
Comments are very important. They provide reminders to yourself, and others, as to what you intended when you wrote a particular line of code. Any line starting with a # is not executed. It is just a comment, or note, about what is happening.