69 | | Three things to note: |
70 | | 1. The double equals in location=='HERE' on the first line. It is called the ''condition''. This is a equals comparison. Other kinds of comparisons in python are listed here. Also note on that line 'HERE' is in quotes. That's to indicate its a string (a text value) not some variable. |
71 | | 2. Spacing and indents in Python are important. the line "We're here..." and the line below it are indented to indicate its a part of a statement ''block'' to run when the condition is ''true''. The second block on the else is run when the condition is ''false'', and only contains one lines. If you want to do stuff outside of the IF-THEN, don't indent it like the first and last print statements. |
| 72 | 1. The double equals in location=='HERE' on the first line. It is called a ''condition''. This is a equals comparison. Other kinds of comparisons in python are listed here. Also note on that line 'HERE' is in quotes. That's to indicate its a string (a text value) not some variable. |
| 73 | 1. Spacing and indents in Python are important. the line "We're here..." and the line below it are indented to indicate its a part of a statement ''block'' to run when the condition evaluates to ''True''. The second block on the else is run when the condition to ''False'', and only contains one line. If you want to do stuff outside of the IF-THEN, don't indent it like the first and last print statements. |
| 74 | 1. You'll see that a few of the print statements end with a {{\\n}}. This is called a ''escape sequence'', and its shorthand for a newline. When the computer sees it in a print statement, it will add an extra line to the output. See here for other escape sequences you can add. |