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.
27 tasks
- Predict the outputBasicThree kinds of divisionOperators · Theory and practiceArithmetic operatorsInteger division and remainder: // and %
- Complete the codeElementaryIs the number even?Operators · Theory and practiceReading numbers from inputInteger division and remainder: // and %Comparisons: ==, !=, <, >=
- Write a programBasicDivisible by 3 and 5Operators · Programming challengesInteger division and remainder: // and %Comparisons: ==, !=, <, >=Logical operators: and, or, not
- Write a programElementaryA four-digit number backwardsOperators · Programming challengesArithmetic operatorsInteger division and remainder: // and %
- Write a programIntermediateThe time a few minutes laterOperators · Programming challengesFormatting output: sep, end, f-stringsArithmetic operatorsInteger division and remainder: // and %
- Predict the outputElementaryA condition inside a conditionConditions · Theory and practiceInteger division and remainder: // and %Nested conditions
- Write a programIntermediateParking feeConditions · Programming challengesFormatting output: sep, end, f-stringsInteger division and remainder: // and %Two branches: if – elseSeveral branches: elif
- Write a programElementaryCounting digits without textLoops · Programming challengesInteger division and remainder: // and %while loopsCounting and summing in a loop
- Predict the outputElementaryA list in one lineLists · Theory and practiceInteger division and remainder: // and %List comprehensions
- Complete the codeElementaryQuotient and remainder at onceTuples · Theory and practiceInteger division and remainder: // and %Return values: returnReturning several values
- Write a programIntermediateConverting to a baseAlgorithms · Programming challengesInteger division and remainder: // and %while loopsDivisibility, primes, GCD
- Find the bugElementaryThe digit sumRecursion · Theory and practiceInteger division and remainder: // and %Recursive algorithms
- Write a programElementaryCounting digits recursivelyRecursion · Programming challengesInteger division and remainder: // and %Recursive functionsThe base case
- Small projectIntermediateBirth numberGraduation exam preparation · StringsConverting types: int(), float(), str()Integer division and remainder: // and %The if statementSlicingString methods: upper, find, replace, …
- Write a programIntermediateMind readerGraduation exam preparation · StringsReading numbers from inputInteger division and remainder: // and %while loopsReturn values: returntry – except
- Algorithmic problemElementaryGreatest common divisorGraduation exam preparation · StringsInteger division and remainder: // and %while loopsDivisibility, primes, GCD
- Write a programElementaryCaesar cipherGraduation exam preparation · StringsInteger division and remainder: // and %Several branches: elifLooping over a stringCharacters and codes: ord() and chr()
- Write a programElementaryEven and odd, sortedGraduation exam preparation · ListsInteger division and remainder: // and %while loopsList methods: append, pop, remove, …len, sum, min, max and sorted
- Write a programBasicSum of even numbersGraduation exam preparation · ListsInteger division and remainder: // and %Counting and summing in a loopReturn values: returnLooping over a list
- Write a programElementaryTime in secondsGraduation exam preparation · The while loopReading numbers from inputFormatting output: sep, end, f-stringsInteger division and remainder: // and %while loops
- Algorithmic problemElementaryThe Collatz sequenceGraduation exam preparation · The while loopReading numbers from inputInteger division and remainder: // and %Two branches: if – elsewhile loops
- Algorithmic problemElementaryTo binaryGraduation exam preparation · The while loopText: the str typeReading numbers from inputInteger division and remainder: // and %while loops
- Write a programElementaryPrime numbersGraduation exam preparation · Mixed tasksInteger division and remainder: // and %while loopsReturn values: returnDivisibility, primes, GCD
- Write a programElementaryPerfect numbersGraduation exam preparation · Mixed tasksInteger division and remainder: // and %for loops and range()Return values: returnDivisibility, primes, GCD
- Write a programBasicLeap yearGraduation exam preparation · Mixed tasksReading numbers from inputInteger division and remainder: // and %Logical operators: and, or, notTwo branches: if – else
- Fix the programElementaryFix the prime testGraduation exam preparation · Mixed tasksInteger division and remainder: // and %The if statementfor loops and range()Divisibility, primes, GCD
- 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, …