Python tasks
Every task in one place. Pick a mode, a topic or a concept to practise.
Every task of the course, from quick understanding checks to exam-style problems.
15 tasks
- Predict the outputBasicA caught errorExceptions · Theory and practicetry – except
- Predict the outputElementaryRaising an exceptionExceptions · Theory and practicetry – exceptRaising an exception: raise
- True / falseBasicWhat is skipped?Exceptions · Theory and practicetry – except
- Complete the codeElementaryA safe conversion to a numberExceptions · Theory and practicetry – exceptKinds of exceptions: ValueError, ZeroDivisionError, …Validating input
- Write a programBasicThe price of an itemExceptions · Programming challengesKeys and valuestry – exceptKinds of exceptions: ValueError, ZeroDivisionError, …
- Write a programElementaryA safe quotientExceptions · Programming challengestry – exceptKinds of exceptions: ValueError, ZeroDivisionError, …Validating input
- Write a programIntermediateReading a decimal numberExceptions · Programming challengeswhile loopsString methods: upper, find, replace, …try – exceptValidating input
- Write a programIntermediateMind readerGraduation exam preparation · StringsReading numbers from inputInteger division and remainder: // and %while loopsReturn values: returntry – except
- Write a programElementaryTest scoresGraduation exam preparation · Mixed tasksFormatting output: sep, end, f-stringswhile loopsList methods: append, pop, remove, …len, sum, min, max and sortedtry – except
- Write a programBasicA numeric passwordGraduation exam preparation · Exceptions (try – except)while loopsbreak and continuetry – exceptValidating input
- Small projectElementaryGuess a number from 1 to 50Graduation exam preparation · Exceptions (try – except)Several branches: elifwhile loopstry – exceptValidating inputStandard modules: math, random
- Write a programElementaryA bounded Fibonacci sequenceGraduation exam preparation · Exceptions (try – except)Reading numbers from inputwhile loopsList methods: append, pop, remove, …try – except
- 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, …