Must-do problems: Functions
90 min ยท Beginner
Need help? Ask a tutor on WhatsApp (opens in a new tab)These are the function problems every Python beginner should be able to solve, from a one-line square to the Tower of Hanoi. Write the function first, then the few lines that read the input and print the answer. Trace each one on paper with a small input, then check your program against every test.
What you will learn
What you will learn
- Move a calculation into a function that returns its result
- Use default arguments, *args and several return values
- Write recursive functions with a base case
- Split a bigger task into small helper functions
Sign in to continue this lesson
Create an account to read every lesson, practise with the exercises and keep track of your progress.