Lesson 01
Practice List
Use this Python revision list to practice swap, strings, collections, files, classes, patterns, threads, sockets, and SQL queries.
Use this Python revision list to practice swap, strings, collections, files, classes, patterns, threads, sockets, and SQL queries.
Example
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
- Swap two values with a temporary name
- Count vowels in a short word
- Second largest in a list of numbers
- Flow practice for a total, a search, and a stop
- Read a file with
readand close it - Define a class and create one object
- Validate a pattern with
searchand a length check - Wait with join before the next main-thread line
- Send one request and read one reply
- Insert, then select and commit before you trust the row
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