Introduction to Python
Python is a beginner-friendly, versatile programming language used in web development, data science, automation, and artificial intelligence.
Why Learn Python?
- Clean, readable syntax
- Huge community and job market
- Used at HK universities, tech companies, and banks
- Great for data analysis and automation
- Popular in DSE ICT and computing courses
Installing Python
Download from python.org or use an online editor like Replit.
Check your version:
python --version
Your First Python Program
# Hello World
print("Hello, Hong Kong!")
# Variables
name = "Chan Tai Man"
age = 20
city = "Hong Kong"
print(f"My name is {name}. I am {age} years old from {city}.")
Python vs JavaScript
| Feature | Python | JavaScript |
|---|---|---|
| Syntax | Indentation-based | Curly braces |
| Primary use | Backend, data | Frontend, fullstack |
| Beginner-friendly | Very high | High |
| HK job demand | High | Very high |
Running Python
# In terminal
python app.py
# Or run online at replit.com
print("No installation needed online!")