We use Python 3.6

What to code next?

Bite Description & Tags
Bite 1. Sum n numbers take this bite for free Write a function that can sum up numbers:It should receive ...
default args None range sum
Bite 2. Regex Fun Learn Python regular expressions by writing the following 3 functions. ...
findall re regular expressions
Bite 3. Word Values Calculate the dictionary word that would have the most value ...
max Scrabble sum
Bite 4. Top 10 PyBites tags Get the top 10 tags of PyBites. Our tests suppose ...
Counter findall
Bite 5. Parse a list of names take this bite for free In this bite you will work with a list of ...
lambda list comprehensions min sorting
Bite 6. PyBites Die Hard Given a listing of files of our community branch determine ...
Counter file processing generators namedtuple
Bite 7. Parsing dates from logs In this bite we will look at this small server ...
datetime file processing
Bite 8. Rotate string characters Write a function that rotates characters in a string, in ...
deque slicing
Bite 9. Palindromes Write a function to determine if a word (or phrase) ...
list comprehensions max reverse
Bite 10. Practice exceptions In this bite you learn to catch/raise exceptions.Write a simple ...
exception handling raise
Bite 11. Enrich a class with dunder methods Let's enrich an Account class by adding dunder (aka special) ...
dunder methods properties
Bite 12. Write a user validation function Create a function that takes a username and checks for ...
classes exception handling namedtuple
Bite 13. Convert dict to namedtuple/json Write a function to convert the given blog dict to ...
dict json namedtuple
Bite 14. Generate a table of n sequences Write a function that receives one or more sequences. The ...
generators zip
Bite 15. Enumerate 2 sequences Iterate over the given names and countries lists. In each ...
enumerate string formatting
Bite 16. Special PyBites date generator Write a generator that returns special dates for PyBites: Every ...
datetime generators
Bite 17. Form teams from a group of friends Write a function called friends_teams that takes a list of ...
itertools
Bite 18. Find the most common word Write a function that returns the most common (non stop)word ...
Counter data analysis list comprehensions
Bite 19. Write a simple property Write a simple Promo class. Its constructor receives a name ...
datetime properties
Bite 20. Write a context manager Write a context manager to roll back a transaction on ...
context managers dunder methods with statement
Bite 21. Query a nested data structure Given the provided cars dictionary:Get all JeepsGet the first car ...
data structures dictionary comprehensions list comprehensions sorting
Bite 22. Write a decorator with argument Write a decorator called make_html that wraps text inside one ...
decorators
Bite 23. Find words that are > 95% similar Given a list of tags of our blog find the ...
difflib file processing findall itertools SequenceMatcher
Bite 24. ABC's and class inheritance ABC's or Abstract Base Classes are great to enforce a ...
ABCs abstractmethod classes inheritance
Bite 25. No promo twice, keep state in a class In this bite a real world scenario: PyBites has a ...
classes exception handling properties
Bite 26. Dictionary comprehensions are awesome A dictionary comprehension is like a list comprehension, but it ...
dictionary comprehensions
Bite 27. Parse omdb movie json data Working with APIs is very common these days and lucky ...
APIs glob json movie data
Bite 28. Converting date strings to datetimes In this Bite you are provided with a list of ...
Counter datetime findall
Bite 29. Martin's IQ test Martin is preparing to pass an IQ test.The most frequent ...
enumerate string module
Bite 30. Movie data analysis In this Bite we are going to parse a csv ...
data analysis defaultdict mean movie data namedtuple sorting
Bite 31. Matrix multiplication / @ operator Since 3.5 Python has a binary operator to be used ...
dunder methods __matmul__
Bite 32. Don't let mutability fool you In this Bite you are presented with a function that ...
deepcopy mutability
Bite 33. Transpose a data structure Sometimes you need to restructure a nested data structure. For ...
dict zip
Bite 34. Building a Karma app - implement the User class This Bite is about implementing a User class that keeps ...
classes dunder methods namedtuple properties
Bite 35. Having fun with heapq In this Bite you are provided with 3 data structures: ...
datetime heapq
Bite 36. Having fun with *args and **kwargs Write a function called get_profile that takes:a required name,a required ...
args function arguments kwargs
Bite 37. Rewrite a for loop using recursion Although you have to be careful using recursion it is ...
recursion reverse
Bite 38. Using ElementTree to parse XML In this Bite you will use ElementTree to parse some ...
movie data xml
Bite 39. Calculate the total duration of a course In this Bite you read in a text file with ...
datetime findall numbers timedelta
Bite 40. Write a binary search algorithm There are many ways to search for an item in ...
algorithms binary search
Bite 41. Write a login_required decorator If you worked with Flask or Django you must have ...
decorators
Bite 42. Number Guessing Game Class In this Bite you implement a Game class to perform ...
classes games random
Bite 43. Force keyword arguments Write a function called get_profile that can only allows 2 ...
function arguments kwargs
Bite 44. License key generator Write a function called gen_key that creates a license key ...
list comprehensions secrets string module
Bite 45. Keep a queue of last n items How about writing a queue that holds the last 5 ...
deque
Bite 46. You are a programmer! Code Fizz Buzz Here is a beginner Bite to write Fizz Buzz: Fizz ...
fizzbuzz
Bite 47. Write a new password field validator You know these Create a new password forms? They do ...
re string module
Bite 48. Make a bar chart of new Safari books Some time ago we made a little Slack bot to ...
bar chart data analysis
Bite 49. Scrape Packt's html with BeautifulSoup In this Bite you will parse Packt's free learning ebook ...
beautifulsoup namedtuple requests
Bite 50. Make a little PyBites search engine (feedparser) Complete the program below to create a little search command ...
any feedparser list comprehensions namedtuple search
Bite 51. When does Python 2 die on Planet Miller? Imagine you landed on Planet Miller (from the movie Interstellar) ...
datetime
Bite 52. Create a movie quote API with Flask In this Advanced Bite you will implement a full-blown CRUD ...
APIs Flask movie data
Bite 53. Convert text into multiple columns You run a news site and you got feedback that ...
string manipulation
Bite 54. Nicer formatting of a poem or text In this Bite you complete print_hanging_indents to print a poem ...
string manipulation textwrap
Bite 55. Get the latest game releases from Steam's RSS feed The Steam gaming platform has an RSS feed of their ...
feedparser namedtuple
Bite 56. Add a command line interface to our BMI calculator Complete create_parser below so that our BMI program can be ...
argparse
Bite 57. Create a simple calculator that receives command line arguments In this Bite you write a simple calculator that can ...
argparse functools reduce
Bite 58. Using argparse to interface with a grocery cart Below is a Groceries class with add/delete/show/search methods.You as a ...
argparse
Bite 59. Create a multiplication table class of variable length Danny does not like rote learning (nor do we!). He ...
classes dunder methods exception handling numbers
Bite 60. Create a deck of Uno cards In this Bite you will create a deck of Uno ...
list list comprehensions namedtuple
Bite 61. 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
Bite 62. Data structures matter - speed up your Python code In this Bite we provide you with 5 functions which ...
data structures performance
Bite 63. Use an infinite iterator to simulate a traffic light Complete traffic_light using itertools.cycle to return an infinite iterator to ...
iterators itertools namedtuple
Bite 64. Fix a truncating zip function Bert is in charge of organizing an event and got ...
itertools zip
Bite 65. Get all valid dictionary words for a draw of letters This Bite focusses on the use of itertools. To that ...
itertools Scrabble
Bite 66. Calculate the running average of a sequence Write a function that takes a sequence of items and ...
enumerate mean
Bite 67. Working with datetimes This Bite involves solving two problems using datetime:We kicked off ...
datetime timedelta
Bite 68. Remove punctuation characters from a string Complete remove_punctuation which receives an input string and strips out ...
string manipulation string module
Bite 69. Regex Fun - part II It's time for another Regex one! (here is part I)In ...
re regular expressions
Bite 70. Create your own iterator In this Bite you make an iterator called EggCreator by ...
iterators random
Bite 71. Keep state in a class + make its instance callable In this Bite you write a small class to keep ...
classes dunder methods
Bite 72. Retrieve the right Ninja Belt based on score As you have probably seen on the new dashboard you ...
itertools OrderedDict
Bite 73. Organize a meeting between timezones (pytz) Help PyBites community friends find a reasonable common time to ...
pytz timezones
Bite 74. What day of the week were you born on? Complete weekday_of_birth_date which takes a date object of a birthday ...
calendar
Bite 75. Parse Unix cal to a weekday mapping In the last bite we return the weekday from a ...
re Unix zip
Bite 76. The singledispatch countdown challenge We are stoked and grateful to have Martin have you ...
decorators functools singledispatch
Bite 77. New places to travel to You want to find people who have as much exposure ...
set set operations
Bite 78. Find programmers with common languages Similar as last Bite we do another comparison of sequences ...
set set operations
Bite 79. Parse a csv file and create a bar chart We played a bit with the Slack API today and ...
bar chart community csv requests
Bite 80. Check equality of two lists In this Bite we compare two list objects for equality, ...
enum equality list
Bite 81. Filter and order tweets by polarity values In this Bite we collected some random tweets and populated ...
namedtuple TextBlob Twitter
Bite 82. Define a Score Enum and customize it adding methods Starting Python 3.4 there is support for enumerations (not to ...
classmethod enum __str__
Bite 83. At what time does PyBites live? Get to know pytz! pytz brings the Olson tz database ...
pytz timezones
Bite 84. Flatten lists recursively (Droste Bite) Complete flatten that takes a list of lists (which can ...
list recursion
Bite 85. Write an advanced property After Bite 19. Write a simple property let's write a ...
classes properties
Bite 86. Create a RGB-to-Hex converter Designer Mary wants to convert her CSS from statements like ...
string formatting
Bite 87. Convert Decimal to Roman Numerals Complete romanize that takes a decimal number and converts it ...
numbers OrderedDict
Bite 88. Write a performance monitoring context manager It's time for Context Managers part II. In Bite 20 ...
context managers Counter
Bite 89. Playing with lists and dicts In this Bite you are presented with a us_state_abbrev dict ...
data structures dict list
Bite 90. What South Park characters talk most? Did we already tell you we love the collections module? ...
Counter csv data analysis defaultdict requests
Bite 91. Matching multiple strings Catching up after #PyCon2018 ... in this Bite you do ...
all any re string matching
Bite 92. Humanize a datetime In this Bite you will convert a timedelta object into ...
datetime namedtuple
Bite 93. Rock-paper-scissors and generator's send Generators are cool right?! Did you know you can send ...
games random
Bite 94. Parse PyCon talk data from YouTube PyCon2018 was awesome! But you clearly had to choose the ...
list comprehensions max namedtuple
Bite 95. Subclass the dict built-in In this Bite you will subclass the dict built-in to ...
classes inheritance
Bite 96. Build Unix' wc program in Python In this Bite you will convert Unix' wc command into ...
file processing tempfile Unix
Bite 97. BeautifulSoup II - scrape US bank holidays In this Bite we use BeautifulSoup to scrape US bank ...
beautifulsoup defaultdict dict
Bite 98. Code your way out of a grid Given a 2D grid of equal length x and y, ...
looping namedtuple numbers tuple unpacking
Bite 99. Write an infinite sequence generator Write a generator that produces the sequence [1, 'A', 2, ...
generators itertools string module zip
Bite 100. Display the last part of a file (Unix tail) Complete the function below simulating Unix' tail, for example: $ ...
file processing slicing strip Unix
Bite 101. f-strings and a simple if/else take this bite for free The latest way to print to the screen in Python ...
f-strings if/else
Bite 102. Infinite loop, input, continue and break take this bite for free In this Bite we'll get you to take user input ...
break continue input mock.patch while
Bite 103. Loop through a dictionary and pluralise a word You're given a dictionary of people and the number of ...
dict looping
Bite 104. Split and join Split up the message on newline (\n) using the split ...
join split
Bite 105. Slice and dice Take the block of text provided and strip off the ...
replace slicing split string module strip
Bite 106. Strip out vowels and count the number of replacements In this Bite we'd like you to loop over the ...
counting regular expressions replace string manipulation Zen of Python
Bite 107. Filter numbers with a list comprehension Complete the function below that receives a list of numbers ...
list comprehensions modulo
Bite 108. Loop over a dict of namedtuples calculating a total score In this Bite you calculate the total amount of points ...
counting dict namedtuple
Bite 109. Workout dict lookups and raising an exception In this Bite you learn how to lookup values from ...
dict exception handling format pytest string manipulation ternary
Bite 110. Type conversion and exception handling In this Bite you complete the divide_numbers function that takes ...
exception handling raise type casting
Bite 111. Use the ipinfo API to lookup IP country In this Bite you will use the requests library to ...
APIs json mock.patch requests
Bite 112. 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
Bite 113. Filter words with non-ascii characters In this Bite you extract words from a text that ...
all ascii ord unicode
Bite 114. Implement a Color class with classmethods As the new junior developer, you have been charged with ...
classmethod hex __repr__ __str__ string module
Bite 115. Count leading spaces A small but interesting Bite: given a string with leading ...
counting string matching
Bite 116. List and filter files in a directory In this Bite you complete get_files that receives a dirname ...
generators glob os module
Bite 117. Round a number even (a.k.a. banker's rounding) Bankers Rounding is an algorithm for rounding quantities to integers, ...
Decimal rounding
Bite 118. List exercise: return first occurrence indices of duplicated words In this Bite you are presented with a list of ...
counting list comprehensions set
Bite 119. Xmas tree generator In this Bite you complete generate_xmas_tree that takes a rows ...
default args join range string formatting
Bite 120. Write a numbers validation decorator Let's get some more practice with decorators ... in this ...
decorators
Bite 121. Determine the strength of a password In this Bite you evaluate the strength of a password. ...
re string matching
Bite 122. Check if two words are anagrams An anagram is a word or phrase formed by rearranging ...
anagram string matching
Bite 123. Find the user with most friends In this Bite you are presented with a users dict ...
defaultdict looping sorting tuples
Bite 124. Marvel data analysis Remember our Marvel Data Analysis / Alicante PyChallengeDay?We simplified this ...
Counter csv data analysis list comprehensions rounding sum
Bite 125. Get the most recommended books The Tim Ferriss Show is full of wisdom and inspiration. ...
beautifulsoup Counter default args list comprehensions requests
Bite 126. The Emoji (Unicode) Bite Python 3 supports Unicode so we can do cool stuff ...
emojis sys unicode
Bite 127. Return the right ordinal suffix for a number In this Bite you complete a function that takes an ...
dict modulo numbers string manipulation
Bite 128. Work with datetime's strptime and strftime In this Bite you get some more practice with datetime's ...
datetime strftime strptime
Bite 129. Analyze Stock Data In this Bite we will answer some questions about stocks, ...
counting data analysis json requests sorting string manipulation
Bite 130. Analyze some basic Car Data In this exercise you will analyze some basic car data. ...
Counter data analysis list comprehensions set
Bite 131. Screen scraper This is the output from using screenFetch on my junky ...
dict index regular expressions slicing string manipulation
Bite 132. Find the word with the most vowels Finish the get_word_max_vowels function below that takes a text string ...
counting lambda list comprehensions string matching
Bite 133. Convert an Amazon URL into an affiliation link Can you help PyBites automate their Amazon affiliation link creation?Complete ...
regular expressions string manipulation
Bite 134. Two Sums Given a random list of numbers, your task is to ...
index looping sorting sum
Bite 135. Sort a list of book objects In this Bite you are going to look at a ...
attrgetter datetime lambda list namedtuple operator sorting