Lesson 2/6 · Graduation exam preparationNot startedhigh School~150 min
Lists
Lists of numbers and names: generating random values, sorting, filtering, finding the maximum and reading until an end marker.
After this lesson you'll be able to:
- Build lists with a loop and `append`
- Sort, reverse and filter lists
- Read values until an end marker (`-1`)
- Separate randomness from program logic with functions
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 programElements that occur only onceElementary20 XP
- Small projectShopping basketIntermediate30 XP
- Write a programSki jumpersElementary20 XP
- Write a programFibonacci into a listBasic10 XP
- Write a programEven and odd, sortedElementary20 XP
- Write a programA random list reversedBasic10 XP
- Write a programSum of even numbersBasic10 XP
- Write a programThe second largest numberElementary20 XP
- Write a programVowel or consonantElementary20 XP
- Write a programGuest namesElementary20 XP
- Write a programCommon elements of two listsElementary20 XP
- Write a programEntered values reversedBasic10 XP
- Write a programThe largest and the smallest numberBasic10 XP
- Write a programThe most frequent elementElementaryOptional20 XP
- Find the bugAn average that is offElementaryOptional20 XP