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.
17 tasks
- Write a programBasicAll occurrencesAlgorithms · Programming challengesReturn values: returnList methods: append, pop, remove, …Linear search
- Write a programBasicWords reversed with a stackAdvanced data structures · Programming challengesList methods: append, pop, remove, …Stacks and queues
- Write a programBasicFibonacci into a listGraduation exam preparation · Listsfor loops and range()Creating lists and indexingList methods: append, pop, remove, …
- 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 programElementaryWords by their first letterDictionaries · Programming challengesList methods: append, pop, remove, …Keys and valuesLooping over a dictionary: keys, values, items
- 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 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 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 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 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
- Write a programElementaryLotteryGraduation exam preparation · Mixed taskswhile loopsReturn values: returnList methods: append, pop, remove, …Standard modules: math, random
- 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 programElementaryA bounded Fibonacci sequenceGraduation exam preparation · Exceptions (try – except)Reading numbers from inputwhile loopsList methods: append, pop, remove, …try – except
- Write a programIntermediateAll words from the letters a, b, cRecursion · Programming challengesList methods: append, pop, remove, …How recursion unfoldsRecursive algorithms
- Small projectIntermediateShopping basketGraduation exam preparation · ListsFormatting output: sep, end, f-stringswhile loopsList methods: append, pop, remove, …len, sum, min, max and sorted