Introduction
Python - A Quick Start for existing Programers
2 min read
This section is 2 min read, full guide is 44 min read
Published Sep 16 2025, updated Aug 17 2026
21
Show sections list
0
Log in to enable the "Like" button
0
Guide comments
0
Log in to enable the "Save" button
Respond to this guide
Guide Sections
Guide Comments
Python
This is a quick start guide for people that have worked in other programming languages, so know basic programming knowledge, but have never used Python and just want to pick up the syntax quickly.
General characteristics
- Interpreted language - Python is not compiled into machine code beforehand. Instead, the Python interpreter reads and executes code line by line.
- High-level & readable - designed to be simple, human-readable, and expressive.
- Cross-platform - runs on Windows, macOS, Linux, and more.
File & execution
- Python files use the extension:
.py - Code runs top to bottom, line by line.
- Unlike languages such as Java or C, Python does not require a
main()method—execution starts directly from the first line of code.
Run the .py file by calling from the command line (assuming Python 3 is installed):
python3 myfile.pYou can also run an interactive shell that will execute code as it is entered, rather than specifying a .py file. To enter the interactive shell mode:
python3Variables
Dynamically typed - you don’t need to declare variable types. Python infers the type at runtime.
x = 5 # inty = "Hello" # strz = 3.14 # floatVariable types can change:
x = 5x = "Now a string"Code structure
- Indentation-based - Python uses indentation (whitespace) instead of
{}or keywords likebegin/endto define code blocks. - Indents can be tabs or spaces, but not both in the same file.
- Best practice: Use 4 spaces per indent.
- A
:symbol is usually used to denote when an indentation will start.
Example:
# Example if statement indentationx = 10if x > 5: print("x is greater than 5")else: print("x is not greater than 5")# Example for loop indentationfor i in range(5): print("Iteration", i)# Example function definition indentationdef greet(name): print(f"Hello, {name}!")greet("Alice")Comments
Single line comments start with a # symbol:
# This is a comment# This is also a commentprint("hello") # And this is a comment after the print statementMulti line comments are between three matching ' or ":
"""This is a multi line comment.Everything between the 3 double quotes."""'''This is also a multi line comment.Using single quotes.'''