What is python?
Installation
Syntax
Comments
Variables
100

What is python?

Python is a popular programming language.

100

Python is normally...

already installed on many PCs and Macs.

100

Python syntax can be executed by writing directly in the Command Line:

>>> print("Hello, World!")
Hello, World!

100

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.

100

How can you create a variable?

A variable is created the moment you first assign a value to it.

200

Tells us an actual fact of python?

  • The most recent major version of Python is Python 3, which we shall be using in this tutorial. However, Python 2, although not being updated with anything other than security updates, is still quite popular.
200

The way to run a python file is like this on the command line:

C:\Users\Your Name>python helloworld.py

200

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

200

All comments start with a...

Comments starts with a #.

200

What are variables?

Variables are containers for storing data values.  

300

What can Python do?

  • Python can be used on a server to create web applications.
  • Python can be used alongside software to create workflows.
  • Python can connect to database systems. It can also read and modify files.
300

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):

300

What is Python Identation?

Indentation refers to the spaces at the beginning of a code line.

300

What will Python do to comments?

Python will ignore them.

300

What can be done with casting?

If you want to specify the data type of a variable, this can be done with casting.

400

We can use python for....

  • web development (server-side),
  • software development,
  • mathematics,
  • system scripting.
400

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

400

What does python use identation for?

Python uses indentation to indicate a block of code.

400

Comments can also be placed...

at the end of the line. (Python will still ignore them).

400

What can you do with the type() function?

You can get the data type of a variable with the type() function.

500

Compared to other programming languages...

  • Python was designed for readability, and has some similarities to the English language with influence from mathematics.
500

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/

500

Use the same number of spaces in the same block of code, otherwise

Python will give you an error

500

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!")

500

What can single or double quotes do?

String variables can be declared either by using single or double quotes: