Skip to main content
MahiDev — Learn. Build. Become AI-ready.

Lesson 01

Practice List

Use this Python revision list to practice swap, strings, collections, files, classes, patterns, threads, sockets, and SQL queries.

All levels25 min
Practice list hero Module 22 Lesson 1 revision tasks

Use this Python revision list to practice swap, strings, collections, files, classes, patterns, threads, sockets, and SQL queries.

How to use the practice list

Example

python
def swap(m, p):
    hold = m
    m = p
    p = hold
    return m, p

def vowel_count(word):
    return sum(1 for m in word.lower() if m in "aeiou")

def second_largest(values):
    ordered = sorted(set(values), reverse=True)
    return ordered[1]

print(swap("North", "East"))
print(vowel_count("Avery"))
print(second_largest([4, 9, 2, 9, 7]))

The prints are ('East', 'North'), 2, and 7. Avery has two vowels. The highest value 9 is ignored once, so the second largest is 7. Each task below links to the lesson that taught the skill. Predict the result, then run that lesson. This page's playground is the first three tasks with fixed values, so it does not read the keyboard.

Practice list

Key takeaways

  • Predict before you run

  • One task uses one lesson you already have

  • Fixed values keep the playground runnable here

  • Next: Question Bank — short revision questions with answers

  • Previous: Query Metadata

Loading playground…

Check your understanding

Practice List Quiz

What should you do before running a practice task?

1 / 10