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.
13 tasks
- Write a programBasicThe hypotenuse of a triangleModular programs · Programming challengesImporting modulesStandard modules: math, random
- Write a programBasicA random list reversedGraduation exam preparation · ListsReturn values: returnSlicingLooping over a listStandard modules: math, random
- Write a programBasicCoin tossGraduation exam preparation · Mixed tasksfor loops and range()Counting and summing in a loopReturn values: returnStandard modules: math, random
- 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 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 programElementaryElements that occur only onceGraduation exam preparation · ListsReturn values: returnList methods: append, pop, remove, …Looping over a listStandard modules: math, random
- Write a programElementaryLotteryGraduation exam preparation · Mixed taskswhile loopsReturn values: returnList methods: append, pop, remove, …Standard modules: math, random
- 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()
- Small projectElementaryGuess a number from 1 to 50Graduation exam preparation · Exceptions (try – except)Several branches: elifwhile loopstry – exceptValidating inputStandard modules: math, random
- Write a programIntermediateEstimating π by chanceModular programs · Programming challengesCounting and summing in a loopReturn values: returnStandard modules: math, random
- Small projectIntermediateScreensaverGraduation exam preparation · Graphics with tkinterStandard modules: math, randomDrawing on a canvas (tkinter)Animation: after()Buttons and entry fields