Chapter 3

Functions

This chapter taught you how to write your own functions. Separating the tasks your program performs into different functions is helpful. You won’t have to repeat yourself as much, and functions can help organize a program by grouping code into pieces that do specific things.

Minimum

Press the button below to display the youngest person.
Avatar for Josh}

Hi there! I am Josh, I am 35 years old.

Avatar for Jacob}

Hi there! I am Jacob, I am 23 years old.

Recursion

So I was thinking about a solution, then I found a flower and I came up with this

Bean counting

πŸ‘¨πŸ½β€πŸ’»: Enter any phrase and I will count the number of Bs.

This phrase has 0 B letter

This phrase has 0 s letter

Minimum number of Bugs

Add bugs on the code by tapping + or -, and find out which code has the fewest bugs.
πŸ›
πŸ›
πŸ›
πŸ›
πŸ›
πŸ›
πŸ›
πŸ›

Recursive counter

Calculate whether a number is even or odd by subtracting 2 until you get to 0 or 1

Is 7 Even?

Character counter

Tap to see the number of "a"s, "B"s or "c"s on these words
WordCount
BBC0
kakkerlak2
chase1
prejudice0
revival1
sacred1