Python tasks
Every task in one place. Pick a mode, a topic or a concept to practise.
Exam-style tasks. Each shows the concepts it needs - review them first if you like.
3 tasks
- Write a programElementaryIs the number divisible?Graduation exam preparation · Exceptions (try – except)Integer division and remainder: // and %Splitting and joining: split() and join()try – exceptKinds of exceptions: ValueError, ZeroDivisionError, …
- Write a programElementaryA safe averageGraduation exam preparation · Exceptions (try – except)while loopslen, sum, min, max and sortedtry – exceptKinds of exceptions: ValueError, ZeroDivisionError, …
- Predict the outputIntermediatetry, except, else, finallyGraduation exam preparation · Exceptions (try – except)Return values: returntry – exceptKinds of exceptions: ValueError, ZeroDivisionError, …