Pybites Logo

Regular Bite Exercises

The bread and butter of the Pybites Platform, these Regular Bite Exercises will keep you challenged for quite some time. They span three difficulty levels: Beginner (green), Intermediate (yellow) and Advanced (red).

Don't be disheartened if you get stuck. These are real world exercises that are designed to push you. If you find yourself absolutely stuck, feel free to post in our Community and ask for help.

Note: These Bites are accessible as part of our Premium Subscription.

Level Name Tags
Sum n numbers sum None default args freebie range
Parse a list of names freebie lambda min list comprehensions sorting
Rotate string characters slicing deque
Enumerate 2 sequences enumerate string formatting
Pybites date generator generators datetime
Write a property datetime properties
Query a nested data structure data structures sorting dictionary comprehensions list comprehensions
Dictionary comprehensions are awesome dictionary comprehensions
Martin's iq test enumerate string module
Don't let mutability fool you mutability deepcopy
Rewrite a for loop using recursion reverse recursion
Using elementtree to parse xml movie data xml
Force keyword arguments function arguments kwargs
License key generator secrets string module list comprehensions
Keep a queue of last n items deque
You are a programmer! code fizz buzz fizzbuzz
Nicer formatting of a poem or text string manipulation textwrap
Get the latest game releases from steam's rss feed feedparser namedtuple
Add a command line interface to our bmi calculator argparse
Fix a truncating zip function itertools zip
Calculate the running average of a sequence enumerate itertools mean
Working with datetimes datetime timedelta
Remove punctuation characters from a string string module string manipulation
What day of the week were you born on? calendar
New places to travel to set set operations
Check equality of two lists equality list enum
At what time does pybites live? timezones pytz
Matching multiple strings string matching all any
Build unix' wc program in python file processing Unix tempfile
Display the last part of a file (unix tail) file processing strip Unix slicing
Count leading spaces string matching counting
Round a number even (a.k.a. banker's rounding) Decimal rounding
Work with datetime's strptime and strftime datetime strptime strftime
Analyze some basic car data data analysis set Counter list comprehensions
Convert an amazon url into an affiliation link string manipulation regular expressions
Bloodtypes exception handling multi type input enum
Look up a value in 3 dictionaries collections dict
Sorting words with constraint lambda string manipulation sorting
Round a sequence of numbers math rounding list comprehensions
Count the number of files and directories counting directories files os module
Parse an /etc/passwd file output string manipulation split tuple unpacking
Complete a user class: properties and representation dunder methods properties classes __repr__ string manipulation dunder methods f-strings __str__
Simple length converter rounding exception handling numbers
Having fun with python partials rounding partial functools
Create a variable length chessboard modulo stdout range
Group names by country groupby collections defaultdict
Keep a list sorted upon insert bisect data structures classes __str__
Get statistics from pybites test code file processing data analysis statistics
Filter a list of names generators break continue looping
Some logging practice logging callable
Find the number pairs summing up n looping itertools numbers
Write a sphinx docstring docstring data types sphinx
Add type annotations typing type hinting annotations
A countdown generator generators
Validate a license key bool regular expressions
Create a sandwich decorator decorators
Swap case pybites characters string manipulation looping string parsing
Where are the emojis? regular expressions looping emojis list comprehensions list
Write tests for fibonacci fibonacci pytest freebie
Write tests for list_to_decimal exception handling pytest freebie
Test print / standard output stdout list comprehensions capfd capsys pytest
Introducing pandas series string module series pandas
Let's play with pandas series slicing pandas type hinting series numpy
Global vs local variables sum global
Extract users dict from a multiline string string parsing dict
Gc content bioinformatics collections
Most frequent digit in number counting numbers Counter
Major and minor numbers min numbers collections max
Armstrong numbers numbers algorithms
Like there's no tomorrow? datetime
Smallest number numbers
Round to next number math
N digit numbers numbers
Join lists iteration joining list
Print names to columns modulo f-strings print
Pickling objects data wrangling pickle serialization
Decode base64 encoded data base64 encode decode
Identity and equality staticmethod integer caching equality
Reading progress datetime numbers
Iterables intersection functools set operations
Pretty string pprint
Fastapi hello world FastAPI freebie
A little detour: pydantic Pydantic FastAPI freebie
Which words can you type with one hand? comparison set enum
Transform a script into a command line interface (cli) Typer command line
Create your first typer command line interface (cli) application Typer command line
Add a progress bar to your command line interface (cli) Typer rich command line
Python3.9 - dictionary merge union dict
Validate pangram strings hashing string algorithms
Reverse only letters strings stacks queues
Uppercase Vowels loops string manipulation strings Hacktoberfest freebie
Word values sum freebie Scrabble max
Top 10 pybites tags xml Counter
Pybites die hard generators file processing Counter namedtuple
Parsing dates from logs file processing datetime
Palindromes reverse list comprehensions algorithms max
Practice exceptions exception handling raise
Write a user validation function exception handling classes namedtuple
Convert dict to namedtuple/json json dict namedtuple
Generate a table of n sequences generators zip
Form teams from a group of friends itertools
Find the most common word data analysis Counter list comprehensions
Write a decorator with argument decorators
No promo twice, keep state in a class exception handling properties classes
Parse omdb movie json data movie data json APIs glob
Converting date strings to datetimes datetime findall Counter
Movie data analysis freebie data analysis mean defaultdict movie data sorting namedtuple
Transpose a data structure zip dict
Having fun with heapq datetime heapq
Having fun with *args and **kwargs args function arguments kwargs
Calculate the total duration of a course datetime numbers findall timedelta
Write a login_required decorator decorators functools
Write a new password field validator string module re
Make a bar chart of new safari books data analysis bar chart
Scrape packt's html with beautifulsoup beautifulsoup requests namedtuple
When does python 2 die on planet miller? datetime
Create a simple calculator that receives command line arguments reduce argparse functools
Create a multiplication table class of variable length exception handling numbers dunder methods classes
Create a deck of uno cards namedtuple list list comprehensions
Data structures matter - speed up your python code performance data structures
Get all valid dictionary words for a draw of letters itertools set Scrabble
Create your own iterator iterators random
Keep state in a class + make its instance callable dunder methods classes
Retrieve the right ninja belt based on score OrderedDict itertools
Organize a meeting between timezones (pytz) timezones pytz
Find programmers with common languages set set operations
Parse a csv file and create a bar chart bar chart requests csv community
Filter and order tweets by polarity values TextBlob Twitter namedtuple
Define a score enum and customize it adding methods classmethod enum __str__
Flatten lists recursively (droste bite) recursion list
Create a rgb-to-hex converter string formatting
Convert decimal to roman numerals OrderedDict numbers
Playing with lists and dicts data structures list dict
What south park characters talk most? data analysis Counter requests csv defaultdict
Humanize a datetime datetime namedtuple
Subclass the dict built-in classes inheritance
Beautifulsoup ii - scrape us holidays beautifulsoup dict defaultdict
Write an infinite sequence generator generators itertools string module zip
Use the ipinfo api to lookup ip country mock.patch json requests APIs
Filter words with non-ascii characters ascii all ord unicode
Implement a color class with staticmethod __repr__ hex string module staticmethod __str__
List and filter files in a directory generators glob os module
List exercise: return first occurrence indices of duplicated words counting set list comprehensions
Xmas tree generator range string formatting default args join
Write a numbers validation decorator decorators
Check if two words are anagrams string matching anagram
Find the user with most friends sorting looping tuples defaultdict
Get the most recommended books default args beautifulsoup Counter list comprehensions requests
Return the right ordinal suffix for a number modulo numbers string manipulation dict
Analyze stock data counting data analysis string manipulation requests json sorting
Find the word with the most vowels lambda string matching counting list comprehensions
Sort a list of book objects lambda operator datetime attrgetter list sorting namedtuple
Gourmets' nightmare operator sorting intersection Counter
Oop fun at the zoo classmethod itertools classes __str__
Pybites first pandas bite data analysis csv pandas
Primitive date format inferrer classmethod datetime exception handling enum
Exception handling: calculate the winning player exception handling numbers namedtuple
Calculate the number of months passed datetime exception handling dateutil
Rhombus generator string formatting format f-strings
100 weekdays of code date range datetime dateutil
Print car data grouped by manufacturer operator data structures itertools sorting
Turn messy csv into json re string manipulation csv pandas json
Contemporary composers exception handling generators datetime dict namedtuple
Write your own data class data structures type hinting dataclasses hashable sorting
Split a string by spaces or quoted text string manipulation split
Make an index of story characters enumerate string matching collections defaultdict sorting
Filter out accented characters string matching unicode
Create a simple calculator operator exception handling numbers
Vertically align output of counters string formatting
Which packages were upgraded? comparison numbers string manipulation dict
Complete a tox ini file parser class configparser tox properties classes string parsing string matching
Set up future notifications datetime timedelta findall f-strings
Find missing dates datetime pandas dateutil
Parse pybites blog git commit log string parsing data analysis Counter datetime dateutil
Parse a bunch of quotes from html string manipulation regular expressions string parsing dict
Analyze some bite stats data data analysis set csv Counter
Create a simple spelling suggester SequenceMatcher string matching difflib
Calculate number of books to have read at date ... datetime exception handling dateutil
Actor/actress age at movie release dataclasses f-strings dateutil
Parse income distribution from latin america xml xml data analysis defaultdict
Starwars character with highest bmi operator string manipulation tuple unpacking max
Most upvoted stackoverflow python questions beautifulsoup string matching web scraping requests sorting
Add caching to a fibonacci function performance fibonacci cache functools
Analyze nba data with sqlite3 databases data analysis SQL sqlite3
What date is mother's day celebrated? datetime dateutil
Multiple inheritance (__mro__) multiple inheritance __mro__ classes inheritance
Call a cisco nexus 9k device networking requests
Analyze some bite stats data - part ii data analysis sorting csv
Type hinting practice dataclasses type hinting classes
Female speakers @ pycon us beautifulsoup counting gender_guesser data wrangling
Calculate and evenly split the bill Decimal rounding numbers
Suppressing exceptions context managers exception handling
Bite notification planner generators datetime
Parse best selling lists using the ny times api json mock requests APIs
Split an iterable in groups of size n generators iterators itertools looping
Unix file permissions string manipulation dict list comprehensions
Get top titles from news.python.sc string parsing beautifulsoup news web scraping requests sorting namedtuple
Convert warcraft json data to csv json exception handling csv
Create a gravatar url string formatting hashlib gravatar
Thumbs up for operator overloading exception handling classes emojis dunder methods operator overloading
Analyze gold prices comparison string parsing data analysis looping pandas sorting
Make a zipfile of the latest log files pathlib datetime zipfile os module
Capitalize sentences string matching string manipulation regular expressions string parsing
Which bite has the fastest tests? sorting string parsing type casting
User experience matters! suggest matching files pathlib files difflib
Test fizzbuzz fizzbuzz pytest
Test code that parses json and ip ranges dataclasses ipaddress json pytest
Make mutpy's output more digestible data wrangling string parsing looping string matching mutpy
Xmas tree 2.0 string formatting range
Mocking a standard library function pytest random mock.patch
More pandas series practice math series statistics pandas
Codon usage bioinformatics textwrap collections
Scrape pycon events beautifulsoup data analysis web scraping requests pycon json namedtuple
What the flux? math finance pandas
Reverse complement bioinformatics translate string manipulation
Visit all pycons in europe math dataclasses itertools data analysis
Count the number of islands in a grid looping algorithms string
Clamy fernet typing encryption fernet cryptography dataclasses encode
Optimal fund raising math looping algorithms
Measure the size of an island math looping algorithms
Get all class names from a module inspect list comprehensions
Find common words string matching algorithms set operations
Number conversion problem numbers recursion algorithms
Get the most common email domains string parsing Counter web scraping set requests
Pascal triangle Pascal algorithms
Nested list extraction data structures string parsing
Decompress string manipulation recursion
Sum indices sum looping
Class rosters data conversion csv string parsing tuple unpacking
Find the fastest speech string manipulation datetime sorting
Jagged list iteration itertools list
Fasta to 2-line fasta bioinformatics biopython
Base converter exception handling base
Exchange rates datetime sorting dict
Get and write all code from a json file file processing json string manipulation filecmp
Most identical letters in a word string matching casefold Counter max
Split once, delimit many looping split string parsing
Translate coding sequences to proteins bioinformatics biopython
Sqlite3 introduction databases SQL sqlite3
Calculate the median from a dictionary sum sorting median
A simple document class properties classes annotations string method chaining
Scoring objects typing builtins keyword importlib
Alternative constructors classmethod classes
More logging practice logging exception handling
To rent or to stream movies? typing datetime collections dict
Sortable dataclasses and enums dataclasses sorting dunder methods enum
Floating point arithmetic floats rounding numbers arithmetic
Abstract syntax tree (ast) printer AST
Searching for an apartment algorithms
Simple tcp client hashlib TCP/IP client socket multiprocessing secrets networking
Async http client asyncio networking aiohttp client
Create food objects FastAPI freebie
Retrieve food objects FastAPI freebie
Update and delete food objects FastAPI freebie
Pydantic part ii Pydantic FastAPI freebie
Food logging crud FastAPI freebie
Fastapi exception handling FastAPI freebie
Return an html response FastAPI freebie
Citation indexes typing exception handling builtins
Writing better spanish ascii unicode dict unicodedata
Get spelling suggestions typing TextBlob comparison tuple unpacking namedtuple
Hash sql statements hashlib SQL
When to use command line option (cli) options and when cli arguments? Typer command line
Using typer callbacks to create command line interface (cli) parameters Typer command line
Rich excursion - create beautiful tables Typer rich command line
Add a password prompt to your command line interface (cli) Typer command line
Movie theater (refactoring) clean code refactoring
Create wikipedia lorem ipsum text regular expressions beautifulsoup list comprehensions random requests
Rolling two dice for an advantage math itertools mean
Goal tracker datetime date tuple unpacking
Add pi day to the calendar calendar tuple unpacking
Group anagrams array strings defaultdict
Find all letter combinations of a phone number backtracking itertools strings
Coins on the table math
Regex fun re findall freebie regular expressions
Enrich a class with dunder methods dunder methods properties functools
Write a context manager operator overloading context managers dunder methods with statement
Find words that are > 95% similar file processing findall difflib SequenceMatcher itertools
Abc's and class inheritance abstractmethod ABCs classes inheritance
Matrix multiplication / @ operator operator overloading __matmul__ dunder methods
Building a karma app - implement the user class properties classes dunder methods operator overloading namedtuple
Write a binary search algorithm algorithms binary search
Number guessing game class random games classes
Make a little pybites search engine (feedparser) list comprehensions feedparser any search namedtuple
Convert text into multiple columns string manipulation
Using argparse to interface with a grocery cart argparse
Create a variable size paw patrol card deck with random actions itertools random string module namedtuple
Use an infinite iterator to simulate a traffic light iterators itertools namedtuple
Regex fun - part ii re regular expressions
Parse unix cal to a weekday mapping re Unix zip
The singledispatch countdown challenge singledispatch decorators functools
Write a score property properties classes
Write a performance monitoring context manager context managers Counter
Rock-paper-scissors and generator's send random games coroutines
Parse pycon talk data from youtube list comprehensions namedtuple max
Code your way out of a grid numbers looping tuple unpacking namedtuple
Social media username validator typing re regular expressions string manipulation range string matching namedtuple
Determine the strength of a password string matching re
Marvel data analysis sum rounding data analysis Counter list comprehensions csv
The emoji (unicode) bite unicode emojis sys
Screen scraper regular expressions string manipulation index dict slicing
Two sums index sum sorting looping
Calculate a coding streak in days datetime string manipulation timedelta
Record breakers data analysis csv pandas
Manipulate string decorator kwargs string manipulation decorators list
Subclass the list built-in exception handling properties dunder methods mean inheritance operator overloading list statistics median
15-way rock paper scissors exception handling games csv dict
Cli tool: html link converter (stdin to stdout) data wrangling exception handling html stdin string formatting string manipulation sys
Ninja rankings classes bisect heapq tuples dunder methods dataclasses
String manipulation and metrics properties string formatting translate string manipulation Counter list comprehensions dataclasses
Analyze mcdonald's food data data analysis pandas
Make a terminal spinner animation stdout itertools command line time sys
Use pandas to find most common genres in a movie excel sheet data cleaning excel groupby pandas movie data
Strip comments from python code regular expressions string parsing comments
Analyze sales data with pandas data analysis pandas groupby
Create a js-like dict object javascript classes dict inheritance
Calculate my mac's longest uptime data wrangling datetime string parsing dateutil
šŸ„³ minecraft enchantable items beautifulsoup web scraping
Pomodoro with asyncio pomodoro asyncio
Cached property decorator caching decorators properties classes
Write a retry decorator exception handling decorators
Code a translation fixer regular expressions
Parse an email header regular expressions
Analysing @pythonbytes rss feed regular expressions classes max min Counter string matching feedparser type hinting namedtuple
Get sentences from a text data wrangling string manipulation regular expressions
Scrape best programming books data wrangling classes beautifulsoup data cleaning books web scraping sorting
Get the dates ninja belts were earned looping datetime pandas json sorting
Write tests for an account class pytest classes
Zodiacal data parsing datetime pytest fixtures
Test a number guessing game exception handling classes games mock.patch pytest
Test a movie db class classes fixtures SQL sqlite3 movie data pytest
Pybites url shortener string module string manipulation type hinting dict encode decode
Let's play with pandas dataframes dataframes pandas
Composition, inheritance, abstract base class, what? typing ABCs abstractmethod beautifulsoup string formatting composition urllib inheritance web scraping dataclasses namedtuple
Taxable income calculator typing finance properties classes dataclasses namedtuple
Number transformers numbers algorithms
Shortest path (graph bite) graph computer science algorithms
Get father's days by date and country string manipulation string parsing dateutil
Number of coin changes dynamic programming algorithms
Regular expression lookahead/lookbehind regular expressions lookahead lookbehind
Generating sales reports from github data data analysis pandas
Evaluate a bridge hand exception handling properties classes looping sorting enum
Scoring matrices bioinformatics zip enumerate looping numbers
Bowling score looping numbers games
Rename keys iteration data cleaning dict
šŸ„³ pto calculator exception handling string formatting looping datetime calendar numbers
Unique genes bioinformatics biopython
Create file pairs bioinformatics regular expressions files
Magic bytes file processing exception handling images bytes string parsing csv
Ast visitor AST
Longest coding streak fromordinal itertools toordinal timezones
Convert dict keys to snake case string manipulation recursion algorithms
Simple math equation solver exception handling itertools list operations operator math
Convolution in neural networks deep learning numpy
Metropolisā€“hastings algorithm statistics algorithms numpy Markov chain Monte Carlo
Fastapi authentication with jwt (json web tokens) FastAPI freebie
Learn to handle cron schedule expressions exception handling iteration datetime crontab dataclasses
Art thief memoization graph recursion
Organizational chart binary tree depth-first search graph traversal
Hedge maze graph traversal maze breadth-first