Day 3 : Programming for Kids : Functions and Control Structures

Anuj Agarwal
2 min readFeb 23, 2023

--

Day 3: Understanding Functions and Control Structures

Learning Material:

  1. Video: Watch a short video on the concept of functions and control structures in programming. Here is an example video: https://www.youtube.com/watch?v=nW8c7vT6Hl4
  2. Article: Read an article that explains functions and control structures in more detail. Here is an example article: https://www.w3schools.com/python/python_functions.asp
  3. Interactive Tutorial: Complete an interactive tutorial that teaches you how to use functions and control structures in Python. Here is an example tutorial: https://www.learnpython.org/en/Functions

Exercise:

  1. Write a function that takes two numbers as input and returns their sum. Call the function with different values to test it.
  2. Write a function that takes a list of numbers as input and returns the sum of all the numbers in the list. Call the function with different lists to test it.
  3. Write a program that uses a for loop to iterate through a list of numbers and prints out only the even numbers.
  4. Write a program that uses a while loop to prompt the user to enter a number until the number entered is greater than 10. Print out the number entered by the user.

These exercises are designed to help the student practice writing functions and control structures in Python, and reinforce the concepts learned in the learning material. As with Day 1 and Day 2, the exercises should be challenging but not overwhelming, and provide the student with the opportunity to practice writing code on their own.

Day 2: https://anujxagarwal.medium.com/day-2-programming-for-kids-python-program-3dc98e2df550
Day 3:https://anujxagarwal.medium.com/day-3-programming-for-kids-functions-and-control-structures-4595f1459650
Day 4:https://anujxagarwal.medium.com/day-4-programming-for-kids-data-types-and-variables-c85e4488bfa5
Day 5: https://anujxagarwal.medium.com/day-5-programming-for-kids-string-manipulation-e5ff0fdacfec
Day 6:https://anujxagarwal.medium.com/day-6-programming-for-kids-conditionals-and-logic-d7724c050d60
Day 7:https://anujxagarwal.medium.com/day-7-programming-for-kids-loops-f9fe7e712dcc
Day 8:https://anujxagarwal.medium.com/day-8-programming-for-kids-list-4d3c36bbda0d
Day 10: https://anujxagarwal.medium.com/day-10-programming-for-kids-fun-activities-bfb825fa11de
Solutions :https://anujxagarwal.medium.com/kids-programming-fun-activities-programs-ans-d20d7d4170b5

Happy Reading…Comments welcomed.

If this was helpful, hit the ❤️ and follow me.

--

--

Anuj Agarwal
Anuj Agarwal

Written by Anuj Agarwal

Director - Technology at Natwest. Product Manager and Technologist who loves to solve problems with innovative technological solutions.