Lesson 2/2~48 min
Programming challenges
Searching, minimum and maximum, bubble sort and converting to another base.
You can solve exercises without signing in; sign in and your progress is kept.
After this lesson you'll be able to:
- Write a whole program from a specification and check it with tests
- Print exactly what the task asks for - the tests compare the output line by line (trailing spaces do not matter). Write any prompt you like in
input("…"); the tests ignore it. - The last task is an optional bonus if you want more.
What you practise here
- Integer division and remainder: // and %
- while loops
- Nested loops
- Return values: return
- Creating lists and indexing
- List methods: append, pop, remove, …
- Looping over a list
- Returning several values
- Finding the minimum and maximum
- Linear search
+ 2
Real programming tasks: write a program, run it and submit it to be checked, hidden tests included.
Start the challengesMastery and review
Once the tasks are done, check the topic with its mastery test. Review then brings it back at the right time.