PYTHON LANGUAGE
By.
Assist prof. Mohammed Talal Ghazal
WHAT IS PYTHON?
Python is a programming language that lets you tell a computer what to do with simple, readable code.
It’s “high-level” and “interpreted,” meaning you can skip low-level details and run your code right away.
It’s free, open source, and works on Windows, macOS, and Linux.
People use Python for websites, data analysis, AI, automation, and small scripts.
WAYS TO RUN PYTHON CODE
▪ 1) IDLE (comes with Python)
▪ Open IDLE → File → New File → write code → Run → Run Module
▪ Good for very first steps.
▪ 2) Python REPL (Terminal)
▪ Open Terminal/Command Prompt → type python (or python3) → try code at the
>>> prompt.
▪ Good for quick tests.
▪ 3) Run a .py file (Terminal)
▪ Save as [Link] → run: python [Link] (or python3 [Link]).
▪ Good for scripts you want to keep.
WAYS TO RUN PYTHON CODE
▪ 4) Jupyter Notebook (on your computer)
▪ Notebook = code + text + charts in one place.
▪ Open Anaconda Navigator → Jupyter Notebook, or install and run: jupyter
notebook.
▪ Great for learning, data, and step-by-step demos.
▪ 5) Google Colab (in the browser)
▪ Go to [Link] → New Notebook → run cells.
▪ No installs; easy to share.
PYTHON BASICS: VARIABLES & DATA TYPES
INPUT & OUTPUT
LOGIC & COMPARISONS