Python Basics Wrap-Up Problems — Put What You Learned into Code
Three Python basics wrap-up problems: format "1995-08-21" using split and int(), classify submissions with set operations, and compare assignment vs copy() on mutable types.
Problem 1: Parse a date string and reformat it
Take a birthday string birthday and turn it into a more readable format for humans. Split the string, convert each part to an integer with int(), and stitch the result back together with an f-string.
Problem 2: Compare submissions with set operations
You want to compare who submitted assignment A and who submitted assignment B. With set operations, you can pull out the people who submitted both and the people who only submitted one of them in a single line each.
Problem 3: See how mutability really works
You think you copied a list to a new variable, but the two are actually pointing at the same object — that's the classic gotcha with mutable values in Python. Try changing the original after using copy() and after a plain assignment, and watch what happens.
Nice work getting through this
That wraps up Python Basics. You've covered variables and data types, how to choose between strings, lists, dicts, and sets, and assignment vs. copy() for mutable values — pretty much every tool you need to handle data day-to-day. From printing simple values to combining types and transforming data, you can now write and run those programs yourself.
The next chapter, Python Syntax, brings in the control flow you use to actually drive a program: if, for, while, plus function definitions with def / lambda, list comprehensions, decorators, generators, and exception handling with try / except.