Write and Test a Python Function: Interview Practice (Overview)
Whether you’re looking to ace your coding interview or simply to level up your development skills, solvingcoding challenges can help you grow as a programmer. In this Real Python Code Conversation, Philipp challenges Martin to write a function that doubles each character in a string. Through their conversation, you’ll learn how to tackle a coding challenge and stand out from the pack in your job search.
In this video course, you’ll learn how to:
- Usefunctions to write reusable, maintainable code
- Communicate your thoughts in acoding interview
- Use
if __name__ == "__main__"to buildmultipurpose code - Writetests and usetest-driven development
At the end of the course, you’ll get to hear how Martin did with the coding challenge, and you’ll leave with resources for further exploration.
00:01Welcome to Real Python Code Conversations. I’m Philipp,and today I will challenge my teammate Martin with a coding challenge.
00:09I want him to create a function that accepts a string, and the function shouldreturn a string with each character in the original string doubled.So if the function takes the wordMartin, I want the function to returnMMaarrttiinn.
00:28While Martin tries to solve this coding challenge,you will learn a few things along the way.You’ll learn how to tackle a coding challenge, why functions are a good idea,how to communicate your thoughts in a coding interview,what happens when you import a module, and when you should useif __name__ == "__main__".
00:49In addition to solving the coding challenge,Martin will even go a few steps further and create some tests.He will also show which conventions about tests exist and whattest-driven development is.
01:04Real Python Code Conversations is an unfiltered video course format. Martinand I will have a conversation about the codehe writes. The session was recorded in one go,but I will jump in now and then to explain some things. All right,let’s get started.
Course Contents

