Python Basics
Display text:
- This will display the text to the console
- Alternatively you can replace each double quote symbol with a single quote
Add comments:
- Anything you type to the right of "#" is a comment and will not be read as code
- You can have a comment block (multiple lines) by putting code between two sets of 3 quote symbols ''' single quote ''' , or """ double quotes """
Store values (variables):
- You can then access this value later by name
- A variable name can be more than 1 letter, and names with multiple words are usually separated with an underscore (e.g. 'my_value')
- You can also store text, e.g. my_name = "Bob"
Do Math:
- You can also use +, -, *, ...
Display multiple things:
- This will display "I am 5 years old", assuming you ran the code to give x a value
All together:
- This will display "Jane is at least 264 months old"
Challenge
Write a program that will calculate and display how many $16 items Bob can buy with his savings. Store the savings as a variable value, first set it to $736, then $1232.