Python Functions · High School Practice (W11)
50 progressive questions for high school students: function basics, parameters, return values, conditionals/loops inside functions, working with strings, lists, and dicts.
Python Functions Practice Notebook
50 Progressive Questions for High School Students
This notebook introduces Python functions with a high-school level progression.
Learning goals
By the end, students should be able to: - define and call functions - use parameters and return values - use conditionals inside functions - use loops inside functions - iterate through strings, lists, and dictionaries - solve small practical problems using functions - break a larger problem into smaller reusable parts
Important idea: print() vs return
- Use print() when the goal is only to show output on the screen. - Use return when the function should send a result back so it can be reused later.
Directions
- Read each question carefully. - Write the full function in the code cell below each question. - Test your function using the example calls. - Do not worry if your solution is different from a classmate's solution, as long as the output is correct.