Python Programming
We write code in an IDE/IDLE (Integrated Development Environment)
Our IDE is Visual Studio Code (An (Open Source) Microsoft Product)
- Save all files with .py suffix This sets the programming language
- Type code (instructions) print(“text”) = to display the word text
- Save as helloworld.py
- Run the program in the terminal ᐅ (Check the left corner for correct python interpreter)
A string is a list of characters In our previous example, “text” was the string
If we want to split the string onto two lines, we use /n
\n = new line
Print("Hello World\nI love the weather")
Output:
Hello World
I love the weather
\t = new tab
Print("Hello World\tI love the weather")
Output:
Hello World I love the weather
Names of Quotes
Symbols | Names |
---|---|
”” (“) | Double Quotes |
’’ (‘) | Single Quotes |
Maths Operations
Name/Role | Symbol |
---|---|
Add | + |
Subtract | - |
Multiple | * |
Integer Division | // |
Float Division | / |
To the Power of | ** |