Python tasks
Every task in one place. Pick a mode, a topic or a concept to practise.
Programming tasks with tests, from easier to demanding.
10 tasks
- Write a programBasicThe price of an itemExceptions · Programming challengesKeys and valuestry – exceptKinds of exceptions: ValueError, ZeroDivisionError, …
- Write a programBasicA numeric passwordGraduation exam preparation · Exceptions (try – except)while loopsbreak and continuetry – exceptValidating input
- Write a programElementaryA safe quotientExceptions · Programming challengestry – exceptKinds of exceptions: ValueError, ZeroDivisionError, …Validating input
- 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
- 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, …
- 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