Kodewick
Start learning →
Py

Python starter

100 small Python challenges for beginners. Write right away; get one wrong and Wick shows you how your code really runs.

0 / 100 solved
PyPython starter 100PyPython next stepsSQLSQLCC starterC++C++ starterGoGo starter

Conditions if / else: let the program choose0 / 12

#001Weather noteOver 30 degrees: drink waterStarterConditions2 min#002Morning or afternoonGreet by the hourStarterConditions2 min#003Old enough?12 and up for this movieStarterConditions2 min#004Is it even?Can two people share it evenly?StarterConditions Numbers2 min#005The bigger onePick the larger of two numbersStarterConditions2 min#006Ticket priceKids pay lessStarterConditions Numbers2 min#007Is it the weekend?1 is Monday, 7 is SundayStarterConditions2 min#008How sweet?Spoons of sugar to a sweetnessBasicConditions4 min#009Grade itA score to A, B, C or DBasicConditions4 min#010Traffic lightGo or stop by the lightBasicConditions Strings3 min#011Free delivery over 99What to pay, delivery includedBasicConditions Numbers3 min#012Leap year?Does February have a 29th?Mini challengeConditions Numbers6 min

Loops Do one thing many times0 / 14

#013CountdownCount down from 5 to 1, then goStarterLoops2 min#014Count by sevensShow 7, 14, 21, … up to 70StarterLoops2 min#015Add up to nWhat is 1 + 2 + … + nStarterLoops Numbers3 min#016Ways to line upHow many orders for n peopleStarterLoops Numbers3 min#017How many clapsMultiples of 3 from 1 to nStarterLoops Numbers3 min#018Piggy bankOne more each day: when is it enoughBasicLoops Numbers4 min#019Tiling a squareThe smallest side for more than n tilesBasicLoops Numbers4 min#020A times-table rown × 1 to n × 9 in a listStarterLoops Lists3 min#021Star ratingOne star for each pointStarterLoops Strings2 min#022Step goal daysHow many days hit the step goalStarterLoops Lists3 min#023Bouncing ballHalf as high each time: how many bouncesBasicLoops Numbers4 min#024Snack moneyBuy in order until the money runs outBasicLoops Lists4 min#025Sunny streakThe most sunny days in a rowMini challengeLoops Lists6 min#026Lift floorsTotal floors up and downMini challengeLoops Numbers6 min

Strings Join, slice and count text0 / 14

#027Cheer a nameThe name in capitals, plus a "!"StarterStrings2 min#028Count the vowelsHow many vowels in a nameStarterStrings Loops3 min#029Tidy a usernameTrim the spaces, make it lower caseStarterStrings2 min#030Locker tagThe first and last letter of a nameStarterStrings2 min#031Find the cat photosDoes the file name start with catStarterStrings2 min#032How many haCount the ha in a messageStarterStrings2 min#033Name the albumJoin words with dashesStarterStrings Lists2 min#034Hide the phone numberShow the last 4 digits, star the restBasicStrings3 min#035InitialsFirst letters of the words, as capitalsBasicStrings Loops4 min#036Make a hashtag#EachWordCapitalisedTogetherBasicStrings Loops4 min#037Mirror namesDoes the name read the same backwardsBasicStrings3 min#038Chat filterSwap unkind words for ***BasicStrings Loops3 min#039Password checkLong enough, a digit and a capitalMini challengeStrings Loops6 min#040Guess the wordShow guessed letters, _ for the restMini challengeStrings Loops6 min

Lists Keep many things together0 / 16

#041The priciest dishWhat the most expensive dish costsStarterLists2 min#042Pick a checkoutWhich checkout has the shortest queueStarterLists3 min#043Front and backWho is first and who is lastStarterLists2 min#044Class averageThe average, to one decimal placeBasicLists Numbers4 min#045Items in the cartCount what is in the cartStarterLists2 min#046Receipt totalAdd up the prices on a receiptStarterLists Numbers2 min#047Is the toy in stock?Is this toy on the shelf?StarterLists2 min#048Add a songPut a new song at the end of a playlistStarterLists2 min#049Passing scoresKeep only scores of 60 and upStarterLists Loops3 min#050Skip the empty seatsKeep only the seats with someone in themBasicLists Strings4 min#051Scale a recipeTurn a recipe for 2 into one for nBasicLists Numbers4 min#052Top threeThe 3 best scores for the leaderboardBasicLists4 min#053Cold nightsHow many nights were colder than a limitBasicLists Loops3 min#054Invited twiceWho is on the party list more than onceMini challengeLists Loops6 min#055The silver medalThe second-best jump in the contestMini challengeLists Conditions6 min#056Merge the snack listsTwo lists into one, no repeatsMini challengeLists Loops5 min

Dicts Look things up by name0 / 10

#057Menu priceThe price if it is on the menu, else 0StarterDicts Conditions3 min#058Sold a fewTake sales off the stockStarterDicts3 min#059All the petsAdd up the numbers in a dictStarterDicts Numbers2 min#060Pocket dictionaryTranslate it, or leave it as it isStarterDicts Strings3 min#061Pets by kindCount each kind in a list of petsBasicDicts Loops4 min#062Who won the voteThe name with the most votesBasicDicts Loops5 min#063Cart totalPrices times amounts, added upBasicDicts Loops4 min#064Whose number is itLook up a phone book by numberBasicDicts Loops4 min#065Group by classSort a list of students into classesMini challengeDicts Lists6 min#066Word tallyHow often each word is usedMini challengeDicts Strings6 min

Functions Wrap a recipe in a function0 / 10

#067Kilometres to metresGive the answer back with returnStarterFunctions Numbers2 min#068Celsius to Fahrenheit°F = °C × 9 / 5 + 32StarterFunctions Numbers3 min#069Room areaTwo parameters: length and widthStarterFunctions Numbers2 min#070Hello cardNo name given: use a defaultStarterFunctions Strings3 min#071Pizza slices each8 slices a pizza, shared out fairlyStarterFunctions Numbers3 min#072Add the tipA 10% tip unless you say otherwiseBasicFunctions Numbers4 min#073Low and highOne function, two answersBasicFunctions Lists4 min#074A or anUse a little helper functionBasicFunctions Strings4 min#075First free seatA seat number, or None if fullBasicFunctions Lists4 min#076Snack receiptTwo functions work out the totalMini challengeFunctions Mixed6 min

Numbers Money, scores and time0 / 12

#077Split the billOne dinner, four people pay equallyStarterNumbers2 min#078Hours and minutes135 minutes in hours and minutesStarterNumbers3 min#079Egg boxesSix to a box: how many full boxesStarterNumbers2 min#080Battery percentCharge left as a percentageStarterNumbers3 min#081Lucky last digitGet the last digit of a numberStarterNumbers2 min#082Bike speedHow far, how long, how fastStarterNumbers3 min#083Fish tank waterBetween 24 and 28 degrees is rightStarterNumbers Conditions2 min#084Weeks and daysn days off: how many weeks and daysBasicNumbers Lists3 min#085Add up the digitsAdd every digit of a numberBasicNumbers Loops4 min#086Price after the saleTake some percent off, 1 decimalBasicNumbers3 min#087Days to finish a bookSome pages a day: how many daysBasicNumbers Conditions4 min#088Giving changeChange in 10s, 5s and 1sMini challengeNumbers Lists6 min

Mixed A few things you know, together0 / 12

#089Heat alertIs any day this week over 35°StarterLoops Conditions3 min#090Progress textMake a "3 of 5 done" labelStarterStrings Numbers2 min#091The longer nameTwo pet names: pick the longerStarterStrings Conditions2 min#092Roll callWho is missing todayStarterLists Loops3 min#093Best gift on a budgetThe priciest one you can affordBasicLists Conditions4 min#094Make a usernameFirst initial + surname + two digitsBasicStrings Numbers4 min#095Three or more, 10% offBuy 3 or more and the total is 10% offBasicMixed Lists4 min#096The Ding Dong gameSay Ding on 4s and Dong on 6sBasicMixed Loops5 min#097To-do progressHow many are done, out of how manyBasicMixed Strings4 min#098Weekly reading reportTotal, best day, days of half an hourMini challengeMixed Dicts7 min#099Rock, paper, scissorsAfter a few rounds, who won?Mini challengeMixed Strings7 min#100Café order totalPrice an order written in one lineMini challengeMixed Dicts8 min