adapter pattern if __name__ ="__main__"user_fetcher userfetcher('users csv'mailer mailer(mailer send'me@example com'[ ["email"for in user_fetcher fetch_users()]"this is your message""have good daycan you see how it might take bit of effort to get this rightbut how much easier it will be when we want to drop in postgresredisor some external api without changing the code that does the actual sending of the emailnow that you have this beautiful piece of code that sends emails to usersyou might get request for your code to be able to send status updates to social media platform like facebook or twitter you do not want to change your working email-sending codeand you found package or program online that can handle the other side of the integration for you how could you create some sort of messaging interface that would allow you to send messages to many different platforms without changing the code doing the sending to fit each targetor reinventing the wheel to fit your needsthe more general problem we want to solve isthe interface have is not the interface wantas with most common software problemsthere is design pattern for that let' work on sample problem first so we can develop bit of intuition about the solution before we implement it for the problem we have at hand let' begin by oversimplifying the problem we want to plug one piece of code into anotherbut the plug does not fit the socket when trying to charge your laptop when traveling to another countryyou need to get some sort of adapter to adapt your charger plug to the wall socket in our everyday liveswe have adapters for switching between two-pronged plugs and three-pronged socketsor for using vga screens with hdmi outputs or other physical devices these are all physical solutions for the problem of the interface have is not the interface wantwhen you are building everything from the ground upyou will not face this problembecause you get to decide the level of abstraction you are going to use in your system and how the different parts of the system will interact with one another in the real worldyou rarely get to build everything from scratch you have to use the plugin