You just landed a job at "SocialOverlord", a company developing a SaaS product allowing you to write and schedule posts to a variety of social networks.
The whole backend is written in Python (yay!), but unfortunately, the person you're replacing didn't know classes exist (ehrm...) and so they used tuples to represent all the data in the system (not so yay...). Here's a code example:
Refactor this code so that it uses classes instead of tuples to represent social channels and posts. As a starting point, use the code download for this exercise.
The post_a_message function isn't great. The if-statement has to
check for each different type of social network and then call a different
method. If you want to add support for a new social network, you'll need to
add an extra elif part, making the code harder and harder to
read.
Implement a new version of the code that uses abstraction to solve the problem.
Bonus challenge: is there a solution that doesn't need abstraction?
Compatible Python Versions: 3.9+