Python Programming Basics
What is Python?
Python is a high-level, interpreted, general-purpose programming language. Created by
Guido van Rossum and first released in 1991, Python emphasises code readability and
simplicity, making it one of the most popular languages for beginners and professionals alike.
Variables and Data Types
name = "Alice" # String age = 30 # Integer height = 5.7 # Float
is_student = True # Boolean
Control Flow
if age >= 18: print("Adult") elif age >= 13: print("Teenager") else:
print("Child")
Loops
# For loop for i in range(5): print(i) # While loop count = 0 while count
< 5: count += 1
Functions
def greet(name): return f"Hello, {name}!" print(greet("World")) # Hello,
World!
Why Learn Python?
• Beginner-friendly syntax that reads like English.
• Huge standard library and third-party packages (pip).
• Used in web dev, data science, AI, automation, and more.
• Large, supportive community and abundant learning resources.
• High demand in the job market across all industries.