Python function exercises
Write Python functions with parameters, defaults and return values, and let the tests check them in your browser.
Beginner
- 8. Default ParametersA greeting that works with or without a name35 XP3 min
- 200. Apply TwiceGive a function a second go at its own answer25 XP3 min
- 221. Make a MultiplierA factory that builds doublers, triplers and every other kind30 XP4 min
- 239. Make a CounterA tally that remembers where it got to between calls35 XP5 min
Intermediate
- 15. Multiply All ArgumentsMultiply however many numbers you are given55 XP5 min
- 19. Custom FilterKeep only the items that pass a test65 XP6 min
- 276. Run OnceDo the expensive setup the first time and never again60 XP10 min
- 301. Build Your Own partialFill in some arguments now and the rest later70 XP12 min
- 322. Retry on ErrorNetworks hiccup: give a shaky call a few more chances75 XP15 min
- 343. Type-Checked ArgumentsCatch the wrong kind of argument at the door, by name90 XP20 min
Advanced
Expert
Other topics
- Python Basics
- Strings
- Lists
- Dictionaries and sets
- Loops
- 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.