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.
258 tasks
- Multiple choiceBasicPrinting textProgramming basics · Theory and practicePrinting with print()
- Predict the outputBasicStatements run in orderProgramming basics · Theory and practicePrograms and how they runPrinting with print()
- True / falseBasicA commentProgramming basics · Theory and practiceComments
- Predict the outputBasicCommas and pluses in printProgramming basics · Theory and practicePrinting with print()
- Code comprehensionBasicWhy an error?Programming basics · Theory and practicePrinting with print()Error messages
- Fix the programBasicFix the outputProgramming basics · Theory and practicePrinting with print()Error messages
- Write a programBasicThree lines with one printProgramming basics · Programming challengesPrinting with print()
- Write a programBasicNumbers with dashesProgramming basics · Programming challengesPrinting with print()
- Write a programElementaryA house made of charactersProgramming basics · Programming challengesPrinting with print()Error messages
- Write a programElementaryMinutes and seconds in a yearProgramming basics · Programming challengesPrograms and how they runPrinting with print()
- Predict the outputBasicA variable changesVariables and data types · Theory and practiceVariables and assignmentArithmetic operators
- Multiple choiceBasicWhich type is it?Variables and data types · Theory and practiceNumbers: int and float
- Predict the outputElementaryText or number?Variables and data types · Theory and practiceNumbers: int and floatText: the str type
- True / falseBasicThe result of a comparisonVariables and data types · Theory and practiceTruth values: boolComparisons: ==, !=, <, >=
- Find the bugElementaryText and a number togetherVariables and data types · Theory and practiceText: the str typeConverting types: int(), float(), str()
- Complete the codeBasicFrom text to a numberVariables and data types · Theory and practiceConverting types: int(), float(), str()
- Write a programBasicArea and perimeter of a rectangleVariables and data types · Programming challengesVariables and assignmentNumbers: int and float
- Write a programBasicMinutes to hoursVariables and data types · Programming challengesVariables and assignmentNumbers: int and float
- Write a programElementaryText and a number in one sentenceVariables and data types · Programming challengesText: the str typeConverting types: int(), float(), str()
- Write a programElementaryAverage speedVariables and data types · Programming challengesVariables and assignmentNumbers: int and floatConverting types: int(), float(), str()
- Multiple choiceBasicWhat does input() return?Input and output · Theory and practiceText: the str typeInput with input()
- Predict the outputBasicsep and endInput and output · Theory and practiceFormatting output: sep, end, f-strings
- Predict the outputElementaryAn f-stringInput and output · Theory and practiceFormatting output: sep, end, f-stringsArithmetic operators
- True / falseBasicA sum from input?Input and output · Theory and practiceInput with input()Reading numbers from input
- Multiple choiceElementaryRoundingInput and output · Theory and practiceFormatting output: sep, end, f-strings
- Fix the programElementaryThe area of a rectangleInput and output · Theory and practiceReading numbers from inputArithmetic operators
- Write a programBasicSum and average of three numbersInput and output · Programming challengesReading numbers from inputFormatting output: sep, end, f-strings
- Write a programBasicPrice after a discountInput and output · Programming challengesReading numbers from inputFormatting output: sep, end, f-strings
- Write a programBasicTwo numbers reversedInput and output · Programming challengesInput with input()Reading numbers from inputFormatting output: sep, end, f-strings
- Write a programIntermediateA price tableInput and output · Programming challengesReading numbers from inputFormatting output: sep, end, f-strings
- Predict the outputBasicThree kinds of divisionOperators · Theory and practiceArithmetic operatorsInteger division and remainder: // and %
- Multiple choiceBasicWhat is computed first?Operators · Theory and practiceArithmetic operators
- Predict the outputElementaryPowers and the minus signOperators · Theory and practiceArithmetic operators
- True / falseBasicBoth conditions at onceOperators · Theory and practiceComparisons: ==, !=, <, >=Logical operators: and, or, not
- Complete the codeElementaryIs the number even?Operators · Theory and practiceReading numbers from inputInteger division and remainder: // and %Comparisons: ==, !=, <, >=
- Predict the outputBasicAugmented assignmentOperators · Theory and practiceAugmented assignment: +=, -=
- Write a programBasicDivisible by 3 and 5Operators · Programming challengesInteger division and remainder: // and %Comparisons: ==, !=, <, >=Logical operators: and, or, not
- Write a programBasicA reduced ticketOperators · Programming challengesComparisons: ==, !=, <, >=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 outputElementaryWhich branch runs?Conditions · Theory and practiceComparisons: ==, !=, <, >=Several branches: elif
- Multiple choiceBasicWhat belongs to a branch?Conditions · Theory and practiceThe if statement
- True / falseBasicThe else branchConditions · Theory and practiceTwo branches: if – else
- Find the bugBasicA comparison in a conditionConditions · Theory and practiceComparisons: ==, !=, <, >=The if statement
- Predict the outputElementaryA condition inside a conditionConditions · Theory and practiceInteger division and remainder: // and %Nested conditions
- Fix the programElementaryPositive, negative or zeroConditions · Theory and practiceReading numbers from inputTwo branches: if – elseSeveral branches: elif
- Write a programBasicA grade from a testConditions · Programming challengesComparisons: ==, !=, <, >=Several branches: elif
- Write a programElementaryA calculatorConditions · Programming challengesArithmetic operatorsSeveral branches: elifNested conditions
- Write a programIntermediateThree numbers from the smallestConditions · Programming challengesVariables and assignmentThe if statementNested conditions
- Write a programIntermediateParking feeConditions · Programming challengesFormatting output: sep, end, f-stringsInteger division and remainder: // and %Two branches: if – elseSeveral branches: elif
- Multiple choiceBasicrange with a stepLoops · Theory and practicefor loops and range()
- Predict the outputBasicWhile the condition holdsLoops · Theory and practicewhile loops
- Predict the outputElementaryEnding a loop earlyLoops · Theory and practiceThe if statementfor loops and range()break and continue
- True / falseBasicHow many times?Loops · Theory and practicefor loops and range()
- Predict the outputElementaryA loop inside a loopLoops · Theory and practicefor loops and range()Nested loops
- Find the bugElementaryA loop that never endsLoops · Theory and practicewhile loops
- Complete the codeElementaryThe sum from 1 to nLoops · Theory and practiceReading numbers from inputfor loops and range()Counting and summing in a loop
- Write a programBasicMultiples of a numberLoops · Programming challengesFormatting output: sep, end, f-stringsfor loops and range()
- Write a programBasicAn upside-down pyramidLoops · Programming challengesfor loops and range()
- Write a programElementaryCounting digits without textLoops · Programming challengesInteger division and remainder: // and %while loopsCounting and summing in a loop
- Write a programIntermediateThe largest before a negativeLoops · Programming challengeswhile loopsCounting and summing in a loopbreak and continue
- Predict the outputBasicWhat the function returnsFunctions · Theory and practiceDefining and calling functionsReturn values: return
- Predict the outputElementaryA function without returnFunctions · Theory and practiceParameters and argumentsReturn values: return
- Multiple choiceBasicThe return statementFunctions · Theory and practiceReturn values: return
- True / falseBasicTwo parametersFunctions · Theory and practiceParameters and argumentsReturn values: return
- Predict the outputElementaryA variable inside a functionFunctions · Theory and practiceLocal and global variables
- Find the bugBasicA forgotten callFunctions · Theory and practiceDefining and calling functionsParameters and arguments
- Complete the codeElementaryThe larger of two numbersFunctions · Theory and practiceThe if statementParameters and argumentsReturn values: return
- Write a programBasicFunctions for a rectangleFunctions · Programming challengesDefining and calling functionsParameters and argumentsReturn values: return
- Write a programElementaryThe largest of threeFunctions · Programming challengesSeveral branches: elifParameters and argumentsReturn values: return
- Write a programElementaryA square made of rowsFunctions · Programming challengesfor loops and range()Defining and calling functionsParameters and arguments
- Write a programIntermediateThe least common multipleFunctions · Programming challengeswhile loopsDefining and calling functionsReturn values: return
- Multiple choiceBasicCharacters at positionsStrings · Theory and practiceIndexing characters
- Predict the outputElementaryString slicesStrings · Theory and practiceSlicing
- Predict the outputBasicString methodsStrings · Theory and practiceString methods: upper, find, replace, …
- True / falseElementaryChanging a characterStrings · Theory and practiceIndexing characters
- Predict the outputBasicSplit and joinStrings · Theory and practiceSplitting and joining: split() and join()
- Complete the codeElementaryHow many letters a?Strings · Theory and practiceCounting and summing in a loopLooping over a string
- Multiple choiceElementaryThe next letterStrings · Theory and practiceCharacters and codes: ord() and chr()
- Write a programBasicA word downwards and backwardsStrings · Programming challengesSlicingLooping over a string
- Write a programElementarySURNAME, NameStrings · Programming challengesString methods: upper, find, replace, …Splitting and joining: split() and join()
- Write a programElementaryAlternating lettersStrings · Programming challengesIndexing charactersLooping over a stringString methods: upper, find, replace, …
- Write a programIntermediateA number with spacesStrings · Programming challengeswhile loopsSlicingLooping over a string
- Predict the outputBasicAdding to a listLists · Theory and practiceList methods: append, pop, remove, …len, sum, min, max and sorted
- Multiple choiceBasicElements by indexLists · Theory and practiceCreating lists and indexing
- Predict the outputBasicSum, maximum, minimumLists · Theory and practicelen, sum, min, max and sorted
- True / falseElementaryTwo names, one listLists · Theory and practiceCreating lists and indexingList methods: append, pop, remove, …
- Predict the outputElementaryA list in one lineLists · Theory and practiceInteger division and remainder: // and %List comprehensions
- Find the bugElementaryA missing elementLists · Theory and practicefor loops and range()Looping over a list
- Complete the codeElementaryEven numbers onlyLists · Theory and practiceReturn values: returnList methods: append, pop, remove, …Looping over a list
- Write a programBasicPositive and negativeLists · Programming challengesCounting and summing in a loopSplitting and joining: split() and join()Looping over a list
- Write a programElementaryA list backwards without reverseLists · Programming challengesfor loops and range()Creating lists and indexingLooping over a list
- Write a programElementaryWhere the smallest item isLists · Programming challengesReturn values: returnCreating lists and indexingLooping over a list
- Write a programIntermediateShifting by k placesLists · Programming challengesReturn values: returnSlicingCreating lists and indexing
- Predict the outputBasicUnpacking a tupleTuples · Theory and practiceUnpacking: a, b = …
- True / falseBasicChanging a tupleTuples · Theory and practiceTuples and immutability
- Multiple choiceElementaryA one-element tupleTuples · Theory and practiceTuples and immutability
- Predict the outputBasicSwapping valuesTuples · Theory and practiceUnpacking: a, b = …
- Predict the outputElementaryA function returns two valuesTuples · Theory and practiceReturn values: returnReturning several values
- Complete the codeElementaryQuotient and remainder at onceTuples · Theory and practiceInteger division and remainder: // and %Return values: returnReturning several values
- Write a programBasicThe midpoint of a segmentTuples · Programming challengesTuples and immutabilityUnpacking: a, b = …Returning several values
- Write a programBasicA date as a tupleTuples · Programming challengesFormatting output: sep, end, f-stringsSplitting and joining: split() and join()Tuples and immutability
- Write a programElementaryThe warmest and the coldest townTuples · Programming challengesLooping over a listTuples and immutabilityUnpacking: a, b = …
- Write a programIntermediateA rectangle around pointsTuples · Programming challengesUnpacking: a, b = …Returning several valuesFinding the minimum and maximum
- Predict the outputBasicNo repeatsSets · Theory and practiceSets and unique items
- Multiple choiceBasicCommon elementsSets · Theory and practiceUnion, intersection, difference
- True / falseBasicIs it in the set?Sets · Theory and practiceMembership: in
- Predict the outputElementaryDifference and unionSets · Theory and practicelen, sum, min, max and sortedUnion, intersection, difference
- Multiple choiceElementaryAn empty setSets · Theory and practiceSets and unique items
- Complete the codeElementaryThe number of different wordsSets · Theory and practiceSplitting and joining: split() and join()Sets and unique items
- Write a programBasicAre they all different?Sets · Programming challengeslen, sum, min, max and sortedSets and unique items
- Write a programBasicCommon lettersSets · Programming challengesSplitting and joining: split() and join()Sets and unique itemsUnion, intersection, difference
- Write a programElementaryA pangramSets · Programming challengesString methods: upper, find, replace, …Sets and unique itemsMembership: in
- Write a programElementaryMissing numbersSets · Programming challengesfor loops and range()Sets and unique itemsUnion, intersection, difference
- Predict the outputBasicKeys and valuesDictionaries · Theory and practiceKeys and values
- Multiple choiceElementarySafe lookupDictionaries · Theory and practiceKeys and values
- True / falseBasicA missing keyDictionaries · Theory and practiceKeys and values
- Predict the outputElementaryLooping over pairsDictionaries · Theory and practiceLooping over a dictionary: keys, values, items
- Predict the outputElementaryCounting lettersDictionaries · Theory and practiceLooping over a stringCounting occurrences
- Complete the codeElementaryHow often each word appearsDictionaries · Theory and practiceReturn values: returnCounting occurrences
- Write a programBasicA reversed dictionaryDictionaries · Programming challengesReturn values: returnKeys and valuesLooping over a dictionary: keys, values, items
- Write a programElementaryLetter countsDictionaries · Programming challengesString methods: upper, find, replace, …Looping over a dictionary: keys, values, itemsCounting occurrences
- Write a programElementaryWords by their first letterDictionaries · Programming challengesList methods: append, pop, remove, …Keys and valuesLooping over a dictionary: keys, values, items
- Write a programIntermediateTotal points and rankingDictionaries · Programming challengeslen, sum, min, max and sortedTuples and immutabilityLooping over a dictionary: keys, values, itemsCounting occurrences
- Find the bugElementaryThe maximum of negative numbersAlgorithms · Theory and practiceFinding the minimum and maximum
- Multiple choiceElementaryHow many steps?Algorithms · Theory and practiceBinary search
- True / falseBasicWhat binary search needsAlgorithms · Theory and practiceBinary search
- Predict the outputElementaryEuclid's algorithmAlgorithms · Theory and practicewhile loopsUnpacking: a, b = …Divisibility, primes, GCD
- Predict the outputIntermediateOne pass of bubble sortAlgorithms · Theory and practiceUnpacking: a, b = …Sorting
- Complete the codeElementaryWhere is the value?Algorithms · Theory and practiceReturn values: returnLinear search
- Code comprehensionElementaryA prime testAlgorithms · Theory and practiceReturn values: returnDivisibility, primes, GCD
- Write a programBasicAll occurrencesAlgorithms · Programming challengesReturn values: returnList methods: append, pop, remove, …Linear search
- Write a programElementaryMinimum and maximum in one passAlgorithms · Programming challengesLooping over a listReturning several valuesFinding the minimum and maximum
- Write a programIntermediateBubble sort, descendingAlgorithms · Programming challengesNested loopsCreating lists and indexingSorting
- Write a programIntermediateConverting to a baseAlgorithms · Programming challengesInteger division and remainder: // and %while loopsDivisibility, primes, GCD
- Predict the outputElementaryWrite, then readWorking with files · Theory and practiceReading from a fileWriting to a fileThe with statement
- Multiple choiceBasicMode "w"Working with files · Theory and practiceWriting to a file
- True / falseBasicThe with blockWorking with files · Theory and practiceThe with statement
- Predict the outputElementaryAppendingWorking with files · Theory and practiceReading from a fileWriting to a file
- Find the bugElementaryAn invisible characterWorking with files · Theory and practiceReading from a fileProcessing a file line by line
- Complete the codeElementarySumming numbers from a fileWorking with files · Theory and practiceConverting types: int(), float(), str()Reading from a fileProcessing a file line by line
- Write a programBasicSearching a fileWorking with files · Programming challengesReading from a fileThe with statementProcessing a file line by line
- Write a programElementaryThe best resultWorking with files · Programming challengesFinding the minimum and maximumReading from a fileProcessing a file line by line
- Write a programElementaryNames sorted into a fileWorking with files · Programming challengeslen, sum, min, max and sortedReading from a fileWriting to a fileThe with statement
- Write a programIntermediateThe three most common wordsWorking with files · Programming challengesTuples and immutabilityCounting occurrencesReading from a file
- Predict the outputBasicA caught errorExceptions · Theory and practicetry – except
- Multiple choiceBasicWhich exception?Exceptions · Theory and practiceKinds of exceptions: ValueError, ZeroDivisionError, …
- Multiple choiceElementaryOutside the listExceptions · Theory and practiceCreating lists and indexingKinds of exceptions: ValueError, ZeroDivisionError, …
- 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 programElementaryChecking the sides of a rectangleExceptions · Programming challengesReturn values: returnKinds of exceptions: ValueError, ZeroDivisionError, …Raising an exception: raise
- Write a programIntermediateReading a decimal numberExceptions · Programming challengeswhile loopsString methods: upper, find, replace, …try – exceptValidating input
- Predict the outputBasicThe math moduleModular programs · Theory and practiceImporting modulesStandard modules: math, random
- Multiple choiceElementaryfrom … importModular programs · Theory and practiceImporting modules
- True / falseBasicA random whole numberModular programs · Theory and practiceStandard modules: math, random
- Find the bugBasicA name from a moduleModular programs · Theory and practiceImporting modulesStandard modules: math, random
- Code comprehensionBasicWho does whatModular programs · Theory and practiceSplitting a program into functions
- Complete the codeElementaryA dieModular programs · Theory and practiceReturn values: returnImporting modulesStandard modules: math, random
- Write a programBasicThe hypotenuse of a triangleModular programs · Programming challengesImporting modulesStandard modules: math, random
- Write a programBasicFunctions from your own moduleModular programs · Programming challengesImporting modulesYour own modules
- Write a programElementaryGrade statistics in functionsModular programs · Programming challengesReturn values: returnlen, sum, min, max and sortedSplitting a program into functions
- Write a programIntermediateEstimating π by chanceModular programs · Programming challengesCounting and summing in a loopReturn values: returnStandard modules: math, random
- Predict the outputBasicFactorialRecursion · Theory and practiceRecursive functionsThe base case
- Multiple choiceBasicWhy a base caseRecursion · Theory and practiceThe base case
- Predict the outputIntermediateBefore and after the callRecursion · Theory and practiceHow recursion unfolds
- True / falseElementaryRecursion without an endRecursion · Theory and practiceThe base case
- Find the bugElementaryThe digit sumRecursion · Theory and practiceInteger division and remainder: // and %Recursive algorithms
- Complete the codeElementaryA recursive powerRecursion · Theory and practiceRecursive functionsThe base case
- Write a programBasicThe sum from 1 to nRecursion · Programming challengesRecursive functionsThe base case
- Write a programElementaryCounting digits recursivelyRecursion · Programming challengesInteger division and remainder: // and %Recursive functionsThe base case
- Write a programElementaryThe maximum of a list recursivelyRecursion · Programming challengesSlicingThe base caseRecursive algorithms
- Write a programIntermediateAll words from the letters a, b, cRecursion · Programming challengesList methods: append, pop, remove, …How recursion unfoldsRecursive algorithms
- Predict the outputBasicRows and columnsAdvanced data structures · Theory and practiceTwo-dimensional lists
- Multiple choiceBasicA stackAdvanced data structures · Theory and practiceStacks and queues
- True / falseBasicA queueAdvanced data structures · Theory and practiceStacks and queues
- Predict the outputElementaryA list of dictionariesAdvanced data structures · Theory and practiceKeys and valuesLists of dictionaries and nested structures
- Predict the outputIntermediateCareful with multiplying a listAdvanced data structures · Theory and practiceCreating lists and indexingTwo-dimensional lists
- Complete the codeElementaryThe sum of all elementsAdvanced data structures · Theory and practiceNested loopsTwo-dimensional lists
- Write a programBasicWords reversed with a stackAdvanced data structures · Programming challengesList methods: append, pop, remove, …Stacks and queues
- Write a programElementaryThe largest item of a matrixAdvanced data structures · Programming challengesNested loopsFinding the minimum and maximumTwo-dimensional lists
- Write a programIntermediateAverage points per classAdvanced data structures · Programming challengeslen, sum, min, max and sortedLooping over a dictionary: keys, values, itemsLists of dictionaries and nested structures
- Write a programIntermediateHot potatoAdvanced data structures · Programming challengeswhile loopsStacks and queues
- Multiple choiceElementaryAn edge caseAlgorithmic problems · Theory and practiceEdge cases
- Multiple choiceElementaryFast lookupAlgorithmic problems · Theory and practiceMembership: inEfficiency of a solution
- Predict the outputBasicA day-by-day simulationAlgorithmic problems · Theory and practicefor loops and range()Simulation
- True / falseBasicThe minimum of nothingAlgorithmic problems · Theory and practicelen, sum, min, max and sortedEdge cases
- Predict the outputElementaryHow many times can you halve itAlgorithmic problems · Theory and practicewhile loopsEfficiency of a solution
- Fix the programIntermediateThe second largest valueAlgorithmic problems · Theory and practiceSets and unique itemsSortingEdge cases
- Write a programBasicCompressing textAlgorithmic problems · Programming challengesLooping over a stringBreaking a problem into stepsEdge cases
- Write a programElementaryThe medianAlgorithmic problems · Programming challengesReturn values: returnSortingEdge cases
- Write a programElementaryA piece on a game boardAlgorithmic problems · Programming challengesbreak and continueMembership: inSimulation
- Write a programIntermediateCounting pairs with a sum - fastAlgorithmic problems · Programming challengesReturn values: returnCounting occurrencesEfficiency of a solution
- Write a programBasicDigit sumGraduation exam preparation · StringsConverting types: int(), float(), str()Counting and summing in a loopLooping over a string
- Write a programBasicHalf pyramidGraduation exam preparation · StringsInput with input()for loops and range()Slicing
- Write a programElementaryBMI calculatorGraduation exam preparation · StringsReading numbers from inputFormatting output: sep, end, f-stringsArithmetic operatorsSeveral branches: elif
- Write a programBasicFinding a characterGraduation exam preparation · StringsInput with input()String methods: upper, find, replace, …
- Small projectIntermediateBirth numberGraduation exam preparation · StringsConverting types: int(), float(), str()Integer division and remainder: // and %The if statementSlicingString methods: upper, find, replace, …
- Write a programElementaryThe Fibonacci sequenceGraduation exam preparation · StringsVariables and assignmentReading numbers from inputfor loops and range()
- 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 programElementaryA number inside a random numberGraduation exam preparation · StringsConverting types: int(), float(), str()Return values: returnString methods: upper, find, replace, …Standard modules: math, random
- Write a programElementaryCaesar cipherGraduation exam preparation · StringsInteger division and remainder: // and %Several branches: elifLooping over a stringCharacters and codes: ord() and chr()
- Write a programBasicPalindromeGraduation exam preparation · StringsTwo branches: if – elseSlicingString methods: upper, find, replace, …
- Write a programElementaryCharacters and wordsGraduation exam preparation · StringsString methods: upper, find, replace, …Splitting and joining: split() and join()len, sum, min, max and sorted
- Write a programElementaryQuadratic equationGraduation exam preparation · StringsReading numbers from inputArithmetic operatorsSeveral branches: elifStandard modules: math, random
- Small projectElementaryRock, paper, scissorsGraduation exam preparation · StringsLogical operators: and, or, notSeveral branches: elifReturn values: returnStandard modules: math, random
- Write a programElementaryPassword checkGraduation exam preparation · StringsLogical operators: and, or, notThe if statementLooping over a stringString methods: upper, find, replace, …
- Predict the outputElementaryString slicesGraduation exam preparation · StringsIndexing charactersSlicing
- Write a programElementaryElements that occur only onceGraduation exam preparation · ListsReturn values: returnList methods: append, pop, remove, …Looping over a listStandard modules: math, random
- Small projectIntermediateShopping basketGraduation exam preparation · ListsFormatting output: sep, end, f-stringswhile loopsList methods: append, pop, remove, …len, sum, min, max and sorted
- Write a programElementarySki jumpersGraduation exam preparation · ListsFormatting output: sep, end, f-stringsReturn values: returnLooping over a listlen, sum, min, max and sorted
- Write a programBasicFibonacci into a listGraduation exam preparation · Listsfor loops and range()Creating lists and indexingList methods: append, pop, remove, …
- 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 programBasicA random list reversedGraduation exam preparation · ListsReturn values: returnSlicingLooping over a listStandard modules: math, random
- 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 programElementaryThe second largest numberGraduation exam preparation · ListsList methods: append, pop, remove, …len, sum, min, max and sortedSets and unique itemsFinding the minimum and maximum
- Write a programElementaryVowel or consonantGraduation exam preparation · ListsSeveral branches: elifwhile loopsString methods: upper, find, replace, …Membership: in
- Write a programElementaryGuest namesGraduation exam preparation · Listswhile loopsString methods: upper, find, replace, …Splitting and joining: split() and join()List methods: append, pop, remove, …
- Write a programElementaryCommon elements of two listsGraduation exam preparation · ListsReturn values: returnList methods: append, pop, remove, …Looping over a listMembership: in
- Write a programBasicEntered values reversedGraduation exam preparation · ListsReading numbers from inputwhile loopsSlicingList methods: append, pop, remove, …
- Write a programBasicThe largest and the smallest numberGraduation exam preparation · Listswhile loopsList methods: append, pop, remove, …len, sum, min, max and sortedFinding the minimum and maximum
- Write a programElementaryThe most frequent elementGraduation exam preparation · ListsSplitting and joining: split() and join()List methods: append, pop, remove, …len, sum, min, max and sortedFinding the minimum and maximum
- Find the bugElementaryAn average that is offGraduation exam preparation · ListsCounting and summing in a loopLooping over a listlen, sum, min, max and sorted
- Write a programElementaryTime in secondsGraduation exam preparation · The while loopReading numbers from inputFormatting output: sep, end, f-stringsInteger division and remainder: // and %while loops
- Write a programBasicGuess the wordGraduation exam preparation · The while loopInput with input()The if statementwhile loopsString methods: upper, find, replace, …
- Write a programBasicNumbers without 3, 7 and 14Graduation exam preparation · The while loopReading numbers from inputLogical operators: and, or, notThe if statementwhile loops
- Write a programBasicEven numbers up to a limitGraduation exam preparation · The while loopReading numbers from inputwhile loops
- Write a programBasicCharacters and their positionsGraduation exam preparation · The while loopInput with input()while loopsIndexing characters
- Write a programBasicCounting down to 5Graduation exam preparation · The while loopReading numbers from inputThe if statementwhile loops
- Write a programBasicOdd numbers except 17Graduation exam preparation · The while loopComparisons: ==, !=, <, >=The if statementwhile 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 programElementaryLotteryGraduation exam preparation · Mixed taskswhile loopsReturn values: returnList methods: append, pop, remove, …Standard modules: math, random
- Write a programElementaryPrime numbersGraduation exam preparation · Mixed tasksInteger division and remainder: // and %while loopsReturn values: returnDivisibility, primes, GCD
- Write a programElementaryMinimum, count and positionsGraduation exam preparation · Mixed tasksReturn values: returnLooping over a listlen, sum, min, max and sortedFinding the minimum and maximum
- 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 programElementaryPerfect numbersGraduation exam preparation · Mixed tasksInteger division and remainder: // and %for loops and range()Return values: returnDivisibility, primes, GCD
- Write a programBasicCoin tossGraduation exam preparation · Mixed tasksfor loops and range()Counting and summing in a loopReturn values: returnStandard modules: math, random
- Write a programBasicTrain passengersGraduation exam preparation · Mixed tasksReading numbers from inputThe if statementwhile loopsCounting and summing in a loop
- 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
- Small projectElementaryA tuft of grassGraduation exam preparation · Graphics with tkinterfor loops and range()Standard modules: math, randomDrawing on a canvas (tkinter)Events: clicks and keys
- Write a programElementaryA colour-changing squareGraduation exam preparation · Graphics with tkinterDefining and calling functionsStandard modules: math, randomDrawing on a canvas (tkinter)Animation: after()
- Write a programElementaryA text windmillGraduation exam preparation · Graphics with tkinterInput with input()for loops and range()Drawing on a canvas (tkinter)
- Small projectIntermediateScreensaverGraduation exam preparation · Graphics with tkinterStandard modules: math, randomDrawing on a canvas (tkinter)Animation: after()Buttons and entry fields
- Small projectElementaryA row of squaresGraduation exam preparation · Graphics with tkinterfor loops and range()Drawing on a canvas (tkinter)Animation: after()
- Write a programBasicA little houseGraduation exam preparation · Graphics with tkinterDrawing on a canvas (tkinter)
- Write a programBasicCircles by clickingGraduation exam preparation · Graphics with tkinterDefining and calling functionsDrawing on a canvas (tkinter)Events: clicks and keys
- Write a programElementaryColoured raysGraduation exam preparation · Graphics with tkinterSeveral branches: elifDefining and calling functionsDrawing on a canvas (tkinter)Events: clicks and keys
- 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, …