Lesson 4/6 · Graduation exam preparationNot startedhigh School~120 min
Mixed tasks
Tasks where loops, lists, functions and chance meet: a lottery, primes, perfect numbers, test scores and train passengers.
After this lesson you'll be able to:
- Split a program into functions with parameters and return values
- Use a function inside another function
- Combine loops, lists and conditions in one program
Theory (PDF)
The theory for this lesson is being prepared.
Examples to try
Your code runs only in this browser, in an isolated environment with no access to the internet or your account.
Examples for this lesson are being prepared.
Exercises
Start the exercises- Write a programLotteryElementary20 XP
- Write a programPrime numbersElementary20 XP
- Write a programMinimum, count and positionsElementary20 XP
- Write a programTest scoresElementary20 XP
- Write a programPerfect numbersElementary20 XP
- Write a programCoin tossBasic10 XP
- Write a programTrain passengersBasic10 XP
- Write a programLeap yearBasicOptional10 XP
- Fix the programFix the prime testElementaryOptional20 XP