Syntax


Python is an interpreted language (similar to JavaScript)
Python is Object Orientated



install python - versaion 3.11.5
link - python.org/downloads
make sure before you press "Install Now" that you click the Add Python to PATH" checkbox
Python has its own dedicated IDE (Integrated Development Environment)
This is called IDLE Shell and it is installed automatically when you install python.


There are 2 ways to run code
1) typing directly into the shell for single lines of code.
The 3 arrows (>>>) is called the Python shell prompt
Everytime you type some code, press Enter to execute it


2) (File > New File) type (File > Save), (Run > Run module)
creating a ".py" file for multiple lines of code



Resources

link - https://codewith.mu/en/tutorials/



Variables

should start with letters or an underscore
no special characters ! # $ %
can only contain letters, numbers and underscore
are case sensitive




Numbers

integers (whole numbers)
floating point (numbers with a decimal point)
complex nos - extract the real number

variable.real 

complex nos - extract the imaginary number

variable.imag 

conversion int, float, complex



2 + 3 * 5 
(2 + 3) * 5 * (1 + 2)




specifying an asterisk (*) before a variable tells python that you want to include everything



strings
can be single or double quotes
eascape characters \'
concatenation +
access characters variable[]
- either zero based from the left [3]
or negative from the right [-3]



Colours

color = 'Red'
color = 'Orange'
color = 'Blue'
color = 'Yellow'
color = 'Green'
color = 'Violet'






© 2025 Better Solutions Limited. All Rights Reserved. © 2025 Better Solutions Limited Top