1. What is a variable in Python?
👉 A container for storing data values (e.g., x = 10).
2. What is a function in Python?
👉 A reusable block of code defined with def keyword (e.g., def greet().
3. Difference between list and tuple in Python?
👉 List is mutable; tuple is immutable.
4. What is a loop? Give two types.
👉 A control structure for repetition; types: for, while.
5. What is indentation in Python?
👉 Whitespace used to define blocks of code (important for structure).
6. What is an if-else statement?
👉 A conditional control structure for decision making.
7. How do you handle errors in Python?
👉 Using try-except blocks to catch and manage exceptions.
8. What is a dictionary in Python?
👉 A collection of key-value pairs (e.g., {‘name’: ‘Alice’}).
🔹 Topic 2: Data Structures & Algorithms (8 Flashcards)
1. What is a data structure?