Editor

Python basics exercises

Short Python problems on variables, types and operators, each checked by tests as soon as you submit.

Beginner

  1. 1. Hello WorldThe first program everyone writes25 XP2 min
  2. 3. Simple MathA tiny calculator for two numbers25 XP2 min
  3. 4. Is Even?Odd or even, one number at a time30 XP3 min
  4. 5. Maximum of TwoPick the bigger of two numbers30 XP3 min
  5. 6. Absolute ValueHow far is a number from zero?35 XP4 min
  6. 201. Celsius to FahrenheitWhat does 37 degrees feel like on an American thermometer?25 XP3 min
  7. 203. Letter GradeTurn a test score into the letter on a report card25 XP4 min
  8. 220. Leap YearDoes this year get a February 29th?30 XP4 min
  9. 226. Shipping CostWhen is delivery free, and when do heavy boxes pay anyway?30 XP5 min
  10. 253. Split the BillDinner for a group, one card machine, and not a cent left over40 XP8 min
  11. 503. Cinema Ticket PriceThe box office keeps charging the wrong people25 XP3 min
  12. 506. Days in a MonthThirty days has September, and the code has to know it25 XP3 min
  13. 507. Dress for the WeatherCoat, sweater or T-shirt: what does today's temperature call for?25 XP3 min
  14. 509. Fuel Cost of a Road TripHow much will the drive to the beach cost in gas?25 XP3 min
  15. 519. Simple InterestHow much extra does money earn while it sits in the bank?25 XP3 min
  16. 531. Average Star RatingWhy does every product look a little worse than its reviews?30 XP4 min
  17. 532. Bill With Sales TaxThe price on the shelf is not the price at the checkout30 XP5 min
  18. 534. Cans of PaintHow many cans does it take to paint the bedroom wall?30 XP4 min
  19. 540. Days in a MonthThirty days has September, but what about February?30 XP5 min
  20. 546. Minutes to HoursA movie runs 135 minutes: how long is that on a clock?30 XP4 min
  21. 558. Which Quadrant?Find out where a point lands on the graph paper30 XP4 min
  22. 565. Electricity BillThe more power a home uses, the more each unit costs35 XP6 min
  23. 574. Tidy a NumberA form sends numbers as text: turn them back into numbers35 XP5 min

Other topics

Or see every challenge, with study plans, today's challenge and duels.