We use Python โ‰ฅ 3.6

Hone Your Python Skills in the Browser

Bites of Py are self-contained ยฑ 20-60 minute Python Code Challenges you can code and verify in the browser.

 ... or click on one below to get started ๐Ÿ’ช



Bite Description & Tags
Sum n numbers Write a function that can sum up numbers:It should receive ...
default args None range sum
Parse a list of names In this bite you will work with a list of ...
lambda list comprehensions min sorting
Rotate string characters Write a function that rotates characters in a string, in ...
deque slicing
Enumerate 2 sequences Iterate over the given names and countries lists. In each ...
enumerate string formatting
Special PyBites date generator Write a generator that returns special dates for PyBites: Every ...
datetime generators
Write a simple property Write a simple Promo class. Its constructor receives a name ...
datetime properties
Query a nested data structure Given the provided cars dictionary:Get all JeepsGet the first car ...
data structures dictionary comprehensions list comprehensions sorting
Dictionary comprehensions are awesome A dictionary comprehension is like a list comprehension, but it ...
dictionary comprehensions
Martin's IQ test Martin is preparing to pass an IQ test.The most frequent ...
enumerate string module
Don't let mutability fool you In this Bite you are presented with a function that ...
deepcopy mutability
Rewrite a for loop using recursion Although you have to be careful using recursion it is ...
recursion reverse
Using ElementTree to parse XML In this Bite you will use ElementTree to parse some ...
movie data xml
Force keyword arguments Write a function called get_profile that can only allows 2 ...
function arguments kwargs
License key generator Write a function called gen_key that creates a license key ...
list comprehensions secrets string module
Keep a queue of last n items How about writing a queue that holds the last 5 ...
deque
You are a programmer! Code Fizz Buzz Here is a beginner Bite to write Fizz Buzz: Fizz ...
fizzbuzz
Nicer formatting of a poem or text In this Bite you complete print_hanging_indents to print a poem ...
string manipulation textwrap
Get the latest game releases from Steam's RSS feed The Steam gaming platform has an RSS feed of their ...
feedparser namedtuple
Add a command line interface to our BMI calculator Complete create_parser below so that our BMI program can be ...
argparse
Fix a truncating zip function Bert is in charge of organizing an event and got ...
itertools zip
Calculate the running average of a sequence Write a function that takes a sequence of items and ...
enumerate mean
Working with datetimes This Bite involves solving two problems using datetime:We kicked off ...
datetime timedelta
Remove punctuation characters from a string Complete remove_punctuation which receives an input string and strips out ...
string manipulation string module
What day of the week were you born on? Complete weekday_of_birth_date which takes a date object of a birthday ...
calendar
New places to travel to You want to find people who have as much exposure ...
set set operations
Check equality of two lists In this Bite we compare two list objects for equality, ...
enum equality list
At what time does PyBites live? Get to know pytz! pytz brings the Olson tz database ...
pytz timezones
Matching multiple strings Catching up after #PyCon2018 ... in this Bite you do ...
all any re string matching
Build Unix' wc program in Python In this Bite you will convert Unix' wc command into ...
file processing tempfile Unix
Display the last part of a file (Unix tail) Complete the function below simulating Unix' tail, for example: $ ...
file processing slicing strip Unix
Count leading spaces A small but interesting Bite: given a string with leading ...
counting string matching
Round a number even (a.k.a. banker's rounding) Bankers Rounding is an algorithm for rounding quantities to integers, ...
Decimal rounding
Work with datetime's strptime and strftime In this Bite you get some more practice with datetime's ...
datetime strftime strptime
Analyze some basic Car Data In this exercise you will analyze some basic car data. ...
Counter data analysis list comprehensions set

Bite Description & Tags
Word Values Calculate the dictionary word that would have the most value ...
max Scrabble sum
Movie data analysis In this Bite we are going to parse a csv ...
data analysis defaultdict mean movie data namedtuple sorting
Top 10 PyBites tags Get the top 10 tags of PyBites. Our tests suppose ...
Counter findall
PyBites Die Hard Given a listing of files of our community branch determine ...
Counter file processing generators namedtuple
Parsing dates from logs In this bite we will look at this small server ...
datetime file processing
Palindromes Write a function to determine if a word (or phrase) ...
list comprehensions max reverse
Practice exceptions In this bite you learn to catch/raise exceptions.Write a simple ...
exception handling raise
Write a user validation function Create a function that takes a username and checks for ...
classes exception handling namedtuple
Convert dict to namedtuple/json Write a function to convert the given blog dict to ...
dict json namedtuple
Generate a table of n sequences Write a function that receives one or more sequences. The ...
generators zip
Form teams from a group of friends Write a function called friends_teams that takes a list of ...
itertools
Find the most common word Write a function that returns the most common (non stop)word ...
Counter data analysis list comprehensions
Write a decorator with argument Write a decorator called make_html that wraps text inside one ...
decorators
No promo twice, keep state in a class In this bite a real world scenario: PyBites has a ...
classes exception handling properties
Parse omdb movie json data Working with APIs is very common these days and lucky ...
APIs glob json movie data
Converting date strings to datetimes In this Bite you are provided with a list of ...
Counter datetime findall
Transpose a data structure Sometimes you need to restructure a nested data structure. For ...
dict zip
Having fun with heapq In this Bite you are provided with 3 data structures: ...
datetime heapq
Having fun with *args and **kwargs Write a function called get_profile that takes:a required name,a required ...
args function arguments kwargs
Calculate the total duration of a course In this Bite you read in a text file with ...
datetime findall numbers timedelta
Write a login_required decorator If you worked with Flask or Django you must have ...
decorators
Write a new password field validator You know these Create a new password forms? They do ...
re string module
Make a bar chart of new Safari books Some time ago we made a little Slack bot to ...
bar chart data analysis
Scrape Packt's html with BeautifulSoup In this Bite you will parse Packt's free learning ebook ...
beautifulsoup namedtuple requests
When does Python 2 die on Planet Miller? Imagine you landed on Planet Miller (from the movie Interstellar) ...
datetime
Create a simple calculator that receives command line arguments In this Bite you write a simple calculator that can ...
argparse functools reduce
Create a multiplication table class of variable length Danny does not like rote learning (nor do we!). He ...
classes dunder methods exception handling numbers
Create a deck of Uno cards In this Bite you will create a deck of Uno ...
list list comprehensions namedtuple
Data structures matter - speed up your Python code In this Bite we provide you with 5 functions which ...
data structures performance
Get all valid dictionary words for a draw of letters This Bite focusses on the use of itertools. To that ...
itertools Scrabble
Create your own iterator In this Bite you make an iterator called EggCreator by ...
iterators random
Keep state in a class + make its instance callable In this Bite you write a small class to keep ...
classes dunder methods
Retrieve the right Ninja Belt based on score As you have probably seen on the new dashboard you ...
itertools OrderedDict
Organize a meeting between timezones (pytz) Help PyBites community friends find a reasonable common time to ...
pytz timezones
Find programmers with common languages Similar as last Bite we do another comparison of sequences ...
set set operations
Parse a csv file and create a bar chart We played a bit with the Slack API today and ...
bar chart community csv requests
Filter and order tweets by polarity values In this Bite we collected some random tweets and populated ...
namedtuple TextBlob Twitter
Define a Score Enum and customize it adding methods Starting Python 3.4 there is support for enumerations (not to ...
classmethod enum __str__
Flatten lists recursively (Droste Bite) Complete flatten that takes a list of lists (which can ...
list recursion
Create a RGB-to-Hex converter Designer Mary wants to convert her CSS from statements like ...
string formatting
Convert Decimal to Roman Numerals Complete romanize that takes a decimal number and converts it ...
numbers OrderedDict
Playing with lists and dicts In this Bite you are presented with a us_state_abbrev dict ...
data structures dict list
What South Park characters talk most? Did we already tell you we love the collections module? ...
Counter csv data analysis defaultdict requests
Humanize a datetime In this Bite you will convert a timedelta object into ...
datetime namedtuple
Subclass the dict built-in In this Bite you will subclass the dict built-in to ...
classes inheritance
BeautifulSoup II - scrape US bank holidays In this Bite we use BeautifulSoup to scrape US bank ...
beautifulsoup defaultdict dict
Write an infinite sequence generator Write a generator that produces the sequence [1, 'A', 2, ...
generators itertools string module zip
Use the ipinfo API to lookup IP country In this Bite you will use the requests library to ...
APIs json mock.patch requests
Filter words with non-ascii characters In this Bite you extract words from a text that ...
all ascii ord unicode
Implement a Color class with classmethods As the new junior developer, you have been charged with ...
classmethod hex __repr__ __str__ string module
List and filter files in a directory In this Bite you complete get_files that receives a dirname ...
generators glob os module
List exercise: return first occurrence indices of duplicated words In this Bite you are presented with a list of ...
counting list comprehensions set
Xmas tree generator In this Bite you complete generate_xmas_tree that takes a rows ...
default args join range string formatting
Write a numbers validation decorator Let's get some more practice with decorators ... in this ...
decorators
Check if two words are anagrams An anagram is a word or phrase formed by rearranging ...
anagram string matching
Find the user with most friends In this Bite you are presented with a users dict ...
defaultdict looping sorting tuples
Get the most recommended books The Tim Ferriss Show is full of wisdom and inspiration. ...
beautifulsoup Counter default args list comprehensions requests
Return the right ordinal suffix for a number In this Bite you complete a function that takes an ...
dict modulo numbers string manipulation
Analyze Stock Data In this Bite we will answer some questions about stocks, ...
counting data analysis json requests sorting string manipulation

Bite Description & Tags
Regex Fun Learn Python regular expressions by writing the following 3 functions. ...
findall re regular expressions
Enrich a class with dunder methods Let's enrich an Account class by adding dunder (aka special) ...
dunder methods properties
Write a context manager Write a context manager to roll back a transaction on ...
context managers dunder methods with statement
Find words that are > 95% similar Given a list of tags of our blog find the ...
difflib file processing findall itertools SequenceMatcher
ABC's and class inheritance ABC's or Abstract Base Classes are great to enforce a ...
ABCs abstractmethod classes inheritance
Matrix multiplication / @ operator Since 3.5 Python has a binary operator to be used ...
dunder methods __matmul__
Building a Karma app - implement the User class This Bite is about implementing a User class that keeps ...
classes dunder methods namedtuple properties
Write a binary search algorithm There are many ways to search for an item in ...
algorithms binary search
Number Guessing Game Class In this Bite you implement a Game class to perform ...
classes games random
Make a little PyBites search engine (feedparser) Complete the program below to create a little search command ...
any feedparser list comprehensions namedtuple search
Create a movie quote API with Flask In this Advanced Bite you will implement a full-blown CRUD ...
APIs Flask movie data
Convert text into multiple columns You run a news site and you got feedback that ...
string manipulation
Using argparse to interface with a grocery cart Below is a Groceries class with add/delete/show/search methods.You as a ...
argparse
Create a variable size Paw Patrol card deck with random actions The Paw Patrol card deck consists of 32 cards ranging ...
itertools namedtuple random string module
Use an infinite iterator to simulate a traffic light Complete traffic_light using itertools.cycle to return an infinite iterator to ...
iterators itertools namedtuple
Regex Fun - part II It's time for another Regex one! (here is part I)In ...
re regular expressions
Parse Unix cal to a weekday mapping In the last bite we return the weekday from a ...
re Unix zip
The singledispatch countdown challenge We are stoked and grateful to have Martin have you ...
decorators functools singledispatch
Write an advanced property After Bite 19. Write a simple property let's write a ...
classes properties
Write a performance monitoring context manager It's time for Context Managers part II. In Bite 20 ...
context managers Counter
Rock-paper-scissors and generator's send Generators are cool right?! Did you know you can send ...
games random
Parse PyCon talk data from YouTube PyCon2018 was awesome! But you clearly had to choose the ...
list comprehensions max namedtuple
Code your way out of a grid Given a 2D grid of equal length x and y, ...
looping namedtuple numbers tuple unpacking
Social Media Username Validator In this Bite you parse social_platforms below into a dict ...
namedtuple range re regular expressions string manipulation string matching typing
Determine the strength of a password In this Bite you evaluate the strength of a password. ...
re string matching
Marvel data analysis Remember our Marvel Data Analysis / Alicante PyChallengeDay?We simplified this ...
Counter csv data analysis list comprehensions rounding sum
The Emoji (Unicode) Bite Python 3 supports Unicode so we can do cool stuff ...
emojis sys unicode

Feature Free Tier Premium Tier (individuals) Enterprise Tier (ideal for teams)
Monthly Price $ 0.00 $ 9.99
($ 99.99 / year)
$ 9.99 per seat
(> 50 seats? Let's talk ...)
10
Intro Bites + Certificate of Accomplishment
โ˜’
โ˜’
โ˜’
Access to our thriving Slack community *
โ˜’
โ˜’
โ˜’
Number of Bite exercises you have access to
(including their discussion forums)
5
115
115
Highest Ninja Belt ** you can achieve at this time *** PyBites Ninja White Belt PyBites Ninja Blue Belt PyBites Ninja Blue Belt
Earn the Die Hard PyBites Ninja Certificate
(= you coded >= 100 Bites)
None
Run Code Only option to bypass the tests
(in-browser console/ code inspection, no setup)
โ˜
โ˜’
โ˜’
Dashboard to monitor license seat usage
(!= Bite performance)
โ˜
โ˜
โ˜’
More voting weight in platform feature development
โ˜
โ˜
โ˜’
Become a better Pythonista and take your career to the next level ...
And remember: NOTHING beats deliberate practice!
Become Premium Become Enterprise

* Upon confirming your email under Settings you have an opt-in button.
** People doing our 100 Days of Code in Python course unlock ~10 Bites so might reach a Yellow belt (50 points).
*** The Premium/ Enterprise belts will go up as we grow our collection of Bites of Py (more points to be earned) ...