Python basics exercises
Short Python problems on variables, types and operators, each checked by tests as soon as you submit.
Beginner
- 1. Hello WorldThe first program everyone writes25 XP2 min
- 3. Simple MathA tiny calculator for two numbers25 XP2 min
- 4. Is Even?Odd or even, one number at a time30 XP3 min
- 5. Maximum of TwoPick the bigger of two numbers30 XP3 min
- 6. Absolute ValueHow far is a number from zero?35 XP4 min
- 201. Celsius to FahrenheitWhat does 37 degrees feel like on an American thermometer?25 XP3 min
- 203. Letter GradeTurn a test score into the letter on a report card25 XP4 min
- 220. Leap YearDoes this year get a February 29th?30 XP4 min
- 226. Shipping CostWhen is delivery free, and when do heavy boxes pay anyway?30 XP5 min
- 253. Split the BillDinner for a group, one card machine, and not a cent left over40 XP8 min
Other topics
- Strings
- Lists
- Dictionaries and sets
- Loops
- Functions
- Math
- Sorting and searching
- Two pointers
- Sliding window
- Stacks and queues
- Recursion and backtracking
- Dynamic programming
- Greedy
- Graphs
- Trees
- Bit manipulation
- Classes
- Iterators and generators
- Parsing
- Simulation
- Python idioms
- Regular expressions
- Codes and ciphers
- Working with data
- Grids and matrices
- Geometry
- Games and puzzles
- Heaps
- Data structures
Or see every challenge, with study plans, today's challenge and duels.