A Complete Interactive Reference Guide
Variables and printing are the foundation of Python.
name = "Gemini"
age = 25
print(f"Hello, {name}!")
Python organizes data into Lists, Tuples, Sets, and Dictionaries.
fruits = ["apple", "banana", "cherry"]
user_info = {"name": "Dev", "role": "Coder"}
Control flow allows your program to make decisions and repeat tasks using If Statements and Loops.
score = 85
if score >= 90:
print("Grade: A")
elif score >= 80:
print("Grade: B")
else:
print("Grade: C")
Use for loops to iterate over sequences and while loops for conditional repetition.
# For loop
for i in range(3):
print(f"Iteration {i}")
# While loop
count = 5
while count > 0:
print(count)
count -= 1
Understanding the difference between Mutable (changeable) and Immutable (fixed) structures is key.
| Type | Example | Feature |
|---|---|---|
| List | [1, 2, 2] |
Ordered, Changeable |
| Tuple | (1, 2, 2) |
Ordered, Unchangeable |
| Set | {1, 2} |
Unordered, Unique Only |
Theory is nothing without practice. We have 20+ categorized challenges waiting for you.
View All ExercisesOr go straight to the Interactive Compiler