What is python?
Python is a popular programming language.
Python is normally...
already installed on many PCs and Macs.
Python syntax can be executed by writing directly in the Command Line:
>>> print("Hello, World!")
Hello, World!
What can Python Comments be used for?
Comments can be used to explain Python code.
Comments can be used to make the code more readable.
Comments can be used to prevent execution when testing code.
How can you create a variable?
A variable is created the moment you first assign a value to it.
Tells us an actual fact of python?
The way to run a python file is like this on the command line:
C:\Users\Your Name>python helloworld.py
Or by creating a python file on the server, using the .py file extension, and running it in the Command Line:
C:\Users\Your Name>python myfile.py
All comments start with a...
Comments starts with a #.
What are variables?
Variables are containers for storing data values.
What can Python do?
To check if you have python installed on a Windows PC...
Search in the start bar for Python or run the following on the Command Line (cmd.exe):
What is Python Identation?
Indentation refers to the spaces at the beginning of a code line.
What will Python do to comments?
Python will ignore them.
What can be done with casting?
If you want to specify the data type of a variable, this can be done with casting.
We can use python for....
To check if you have python installed on a Linux or Mac...
Then on linux open the command line or on Mac open the Terminal and type: python --version
What does python use identation for?
Python uses indentation to indicate a block of code.
Comments can also be placed...
at the end of the line. (Python will still ignore them).
What can you do with the type() function?
You can get the data type of a variable with the type() function.
Compared to other programming languages...
If you find that you do not have Python installed on your computer...
Then you can download it for free from the following website: https://www.python.org/
Use the same number of spaces in the same block of code, otherwise
Python will give you an error
Besides a comment not having to explain the code, it can also...
be used to prevent Python from executing code:
#print("Hello, World!")
print("Cheers, Mate!")
What can single or double quotes do?
String variables can be declared either by using single or double quotes: