Programming Calibration Test#

Welcome! This test will help determine which course level is right for you.

Instructions#

  1. Complete all sections below by writing code in the designated cells

  2. If you don’t know how to solve a problem, leave it blank - that’s okay!

  3. Run the final scoring cell to see your results and recommended level

Scoring Guide#

  • 0-30 points: Start with the Easy course

  • 31-60 points: Start with the Medium course

  • 61+ points: Start with the Hard course


Section 1: Basic Syntax (10 points)#

Question 1.1 (5 points)#

Write code to print “Hello, Python!” to the console.

# Your code here

Question 1.2 (5 points)#

Create three variables:

  • name (string) with your name

  • age (integer) with any age

  • height (float) with any height

Then print all three variables.

# Your code here

Section 2: Control Flow (15 points)#

Question 2.1 (5 points)#

Write a function called is_even that takes a number and returns True if it’s even, False otherwise.

# Your code here
def is_even(number):
    pass  # Replace 'pass' with your code

# Test your function
print(is_even(4))  # Should print True
print(is_even(7))  # Should print False

Question 2.2 (10 points)#

Write a function called fizzbuzz that takes a number n and:

  • Prints “Fizz” if divisible by 3

  • Prints “Buzz” if divisible by 5

  • Prints “FizzBuzz” if divisible by both

  • Prints the number otherwise

# Your code here
def fizzbuzz(n):
    pass  # Replace with your code

# Test your function
for i in [3, 5, 15, 7]:
    fizzbuzz(i)

Section 3: Data Structures (20 points)#

Question 3.1 (10 points)#

Given the list numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10], use a list comprehension to create a new list containing only the even numbers squared.

numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]

# Your code here (should result in [4, 16, 36, 64, 100])
result = []

print(result)

Question 3.2 (10 points)#

Create a function count_words that takes a string and returns a dictionary with each word as a key and its count as the value.

Example: "hello world hello"{"hello": 2, "world": 1}

# Your code here
def count_words(text):
    pass  # Replace with your code

# Test your function
print(count_words("hello world hello"))
print(count_words("the quick brown fox jumps over the lazy dog"))

Section 4: Object-Oriented Programming (20 points)#

Question 4.1 (20 points)#

Create a BankAccount class with:

  • Constructor that takes owner name and optional balance (default 0)

  • Method deposit(amount) to add money

  • Method withdraw(amount) to remove money (only if sufficient balance)

  • Method get_balance() to return current balance

# Your code here
class BankAccount:
    pass  # Replace with your code

# Test your class
account = BankAccount("Alice", 100)
print(account.get_balance())  # Should print 100
account.deposit(50)
print(account.get_balance())  # Should print 150
account.withdraw(30)
print(account.get_balance())  # Should print 120

Section 5: Advanced Concepts (35 points)#

Question 5.1 (15 points)#

Write a decorator called timer that measures and prints how long a function takes to execute.

import time

# Your code here
def timer(func):
    pass  # Replace with your code

# Test your decorator
@timer
def slow_function():
    time.sleep(0.1)
    return "Done"

slow_function()

Question 5.2 (10 points)#

Create a generator function called fibonacci_generator that yields Fibonacci numbers infinitely.

# Your code here
def fibonacci_generator():
    pass  # Replace with your code

# Test your generator (get first 10 Fibonacci numbers)
fib = fibonacci_generator()
for _ in range(10):
    print(next(fib), end=' ')

Question 5.3 (10 points)#

Implement a function merge_sort that sorts a list using the merge sort algorithm.

# Your code here
def merge_sort(arr):
    pass  # Replace with your code

# Test your function
test_list = [38, 27, 43, 3, 9, 82, 10]
print("Original:", test_list)
print("Sorted:", merge_sort(test_list))

Scoring Cell#

Run this cell after completing all questions to get your score and recommendation.

Self-Scoring Instructions:

  • Give yourself full points if your solution works correctly

  • Give yourself half points if you attempted but didn’t complete it

  • Give yourself 0 points if you left it blank

# Enter your scores for each section
section_1_score = 0  # Out of 10
section_2_score = 0  # Out of 15
section_3_score = 0  # Out of 20
section_4_score = 0  # Out of 20
section_5_score = 0  # Out of 35

total_score = section_1_score + section_2_score + section_3_score + section_4_score + section_5_score

print("=" * 50)
print("CALIBRATION TEST RESULTS")
print("=" * 50)
print(f"\nSection 1 (Basic Syntax):        {section_1_score}/10")
print(f"Section 2 (Control Flow):        {section_2_score}/15")
print(f"Section 3 (Data Structures):     {section_3_score}/20")
print(f"Section 4 (OOP):                 {section_4_score}/20")
print(f"Section 5 (Advanced Concepts):   {section_5_score}/35")
print(f"\n{'TOTAL SCORE:':.<40} {total_score}/100")
print("\n" + "=" * 50)

# Recommendation
if total_score <= 30:
    level = "EASY"
    folder = "easy/"
    description = "Start with the basics! You'll learn fundamental concepts."
elif total_score <= 60:
    level = "MEDIUM"
    folder = "medium/"
    description = "You have a good foundation. Time to level up your skills!"
else:
    level = "HARD"
    folder = "hard/"
    description = "You're ready for advanced topics and algorithms!"

print(f"\nRECOMMENDED LEVEL: {level}")
print(f"\n{description}")
print(f"\nStart with the notebooks in: Education_Playground/{folder}")
print("\n" + "=" * 50)

Next Steps#

Based on your results:

Easy Level (0-30 points)#

Navigate to the easy/ folder and start with:

  1. 01_introduction_to_python.ipynb

  2. 02_variables_and_data_types.ipynb

  3. 03_basic_operations_and_conditionals.ipynb

Medium Level (31-60 points)#

Navigate to the medium/ folder and start with:

  1. 01_functions_and_modules.ipynb

  2. 02_data_structures.ipynb

  3. 03_classes_and_oop.ipynb

Hard Level (61+ points)#

Navigate to the hard/ folder and start with:

  1. 01_advanced_functions_and_decorators.ipynb

  2. 02_generators_and_iterators.ipynb

  3. 03_algorithms_and_complexity.ipynb


Remember: There’s no shame in starting at any level. Everyone learns at their own pace. Good luck on your programming journey!