Skip to content

Python Basics Interactive Quiz

Test your Python programming knowledge with this interactive quiz! Select your answers and get instant scoring.


📋 Assessment Guidelines

📝 Interactive Format

Select answers by clicking radio buttons or checkboxes

✅ Instant Scoring

Submit to see your score and detailed feedback

🔄 Retake Anytime

Reset and try again to improve your score

Question 1: Python Comments

Which symbol is used to write a single-line comment in Python?

Question 2: Indentation

In Python, what is the standard number of spaces for indentation?

Question 3: Variable Types - Multiple Select

Select ALL valid Python data types for numbers:

Question 4: String Indexing

Given the string text = "Python", what does text[1] return?

Question 5: Lists

Which method adds an element to the END of a list?

Question 6: List Slicing

Given numbers = [0, 1, 2, 3, 4, 5], what does numbers[1:4] return?

Question 7: Dictionaries

How do you access the value associated with the key "temperature" in data = {"temperature": 25, "humidity": 60}?

Question 8: Mutable vs Immutable - Multiple Select

Select ALL data structures that are MUTABLE (can be changed after creation):

Question 9: Comparison Operators

What does the operator == do in Python?

Question 10: For Loops

What is the output of this code?
for i in range(3):
    print(i)

Question 11: Functions

Which keyword is used to define a function in Python?

Question 12: Lambda Functions

What is a lambda function in Python?

Question 13: Built-in Functions - Multiple Select

Select ALL valid Python built-in functions:

Question 14: List Comprehension

What does this list comprehension produce?
[x**2 for x in range(4)]

Question 15: Enumerate Function

What does the enumerate() function return?

Question 16: Zip Function

What does list(zip([1, 2], ['a', 'b'])) return?

Question 17: Modules

How do you import a specific function called sqrt from the math module?

Question 18: Error Types - Multiple Select

Select ALL common Python error types:

Question 19: Exception Handling

Which keyword is used to catch exceptions in Python?

Question 20: True or False

In Python, lists can contain elements of different data types (e.g., integers, strings, and floats together).


💡 Tips for Success

  • Think about Python syntax rules before answering
  • Remember that Python is 0-indexed (counting starts at 0)
  • Pay attention to mutable vs immutable data types
  • For multiple select questions, select ALL correct answers
  • Consider the difference between similar functions (e.g., append vs extend)
  • Review your answers before submitting
  • Practice writing actual Python code to reinforce concepts!

📚 Additional Resources


🚀 Key Concepts Covered

This quiz tests your understanding of:

  1. Syntax & Structure - Comments, indentation, keywords
  2. Variables & Types - int, float, complex, strings
  3. Data Structures - Lists, dictionaries, tuples, sets
  4. Operators - Comparison and logical operators
  5. Control Flow - if statements, for loops, while loops
  6. Functions - Definition, lambda functions
  7. Built-in Functions - map(), filter(), len(), sum()
  8. Advanced Features - List comprehensions, enumerate, zip
  9. Modules - Importing and using modules
  10. Error Handling - Common errors and exception handling

Good luck! Python is a powerful tool for climate data analysis! 🐍📊

In Partnership With