Pybites Logo

Pybites's Bite Exercises

Level Name Tags
B Assigning objects newbie variables
B Basic data types newbie data types
B Basic printing newbie print
B Printing objects newbie print
B Basic maths math newbie
B Additional maths math newbie
B User input input newbie
B String manipulation string manipulation newbie
B Lists newbie list
B Returning items by list index newbie list
B Adding and removing items from a list newbie list
B Dicts newbie list dict
B Dict data retrieval methods newbie
B Functions newbie functions
B Functions part ii newbie functions
B Equals operator equality newbie
B If / else newbie if/else
B Truthiness truthiness newbie
B Less than and greater than comparison newbie
B While loop while newbie
B Comments newbie comments
B For loops looping newbie
B Looping through a dict newbie dict
B Tuples tuples newbie
B Calling a function newbie functions
B Reading errors error handling debugging syntax errors newbie
B Failing tests debugging testing pytest newbie
B Type hints type hints newbie
B Default arguments arguments newbie functions
B Special chars strings special characters newline tab newbie
B Word count strings methods newbie
B Dict retrieval - part 2 dictionaries newbie
B Dict retrieval - part 3 dictionaries newbie
B Random module imports random newbie modules
B Working with dates imports datetime newbie modules
B Working with dates - part 2 imports newbie modules
B Make a class newbie classes
B Class with str newbie dunder methods classes
B Make a dataclass dataclasses newbie classes
B Scope newbie scope
B String manipulations strings string manipulation split lowercase lists newbie slicing
B List comprehension list comprehensions newbie numbers integer isdigit
B Named tuple namedtuples newbie collections
B Constants math newbie constants
B Exceptions exceptions error handling newbie functions
B For loop with break and continue loops control flow break continue newbie
B In operator in operator lists newbie collections
B String module string module string manipulation newbie list comprehensions
B Formatting intro strings newbie string interpolation
B Read the docs documentation reading docs collections newbie
B F-strings and a simple if/else f-strings if/else
B Infinite loop, input, continue and break while break continue input mock.patch
B Loop through a dictionary and pluralise a word looping dict
B Split and join split join
B Slice and dice string module split replace slicing
B Strip out vowels and count the number of replacements regular expressions string manipulation replace counting Zen of Python
B Filter numbers with a list comprehension modulo list comprehensions
B Loop over a dict of namedtuples calculating a total score counting dict namedtuple
B Workout dictionary lookups exception handling string manipulation dict format ternary
B Type conversion and exception handling exception handling raise type casting
B Sum n numbers sum None default args range
B Parse a list of names lambda min list comprehensions sorting
B Rotate string characters slicing deque
B Enumerate 2 sequences enumerate string formatting
B Pybites date generator generators datetime
B Write a property datetime properties
B Query a nested data structure data structures sorting dictionary comprehensions list comprehensions
B Dictionary comprehensions are awesome dictionary comprehensions
B Don't let mutability fool you mutability deepcopy
B Rewrite a for loop using recursion reverse recursion
B Using elementtree to parse xml movie data xml
B Force keyword arguments function arguments kwargs
B License key generator secrets string module list comprehensions
B Keep a queue of last n items deque
B You are a programmer! code fizz buzz fizzbuzz
B Nicer formatting of a poem or text string manipulation textwrap
B Get the latest game releases from steam's rss feed feedparser namedtuple
B Add a command line interface to our bmi calculator argparse
B Fix a truncating zip function itertools zip
B Calculate the running average of a sequence enumerate itertools mean
B Working with datetimes datetime timedelta
B Remove punctuation characters from a string string module string manipulation
B What day of the week were you born on? calendar
B New places to travel to set set operations
B Check equality of two lists equality list enum
B At what time does pybites live? timezones pytz
B Matching multiple strings string matching all any
B Build unix' wc program in python file processing Unix tempfile
B Display the last part of a file (unix tail) file processing strip Unix slicing
B Count leading spaces string matching counting
B Round a number even (a.k.a. banker's rounding) Decimal rounding
B Work with datetime's strptime and strftime datetime strptime strftime
B Analyze some basic car data data analysis set Counter list comprehensions
B Convert an amazon url into an affiliation link string manipulation regular expressions
B Look up a value in 3 dictionaries collections dict
B Sorting words with constraint lambda string manipulation sorting
B Round a sequence of numbers math rounding list comprehensions
B Count the number of files and directories counting directories files os module
B Parse an /etc/passwd file output string manipulation split tuple unpacking
B Complete a user class: properties and representation dunder methods properties classes __repr__ string manipulation dunder methods f-strings __str__
B Having fun with python partials rounding partial functools
B Create a variable length chessboard modulo stdout range
B Group names by country groupby collections defaultdict
B Keep a list sorted upon insert bisect data structures classes __str__
B Get statistics from pybites test code file processing data analysis statistics
B Filter a list of names generators break continue looping
B Find the number pairs summing up n looping itertools numbers
B Write a sphinx docstring docstring data types sphinx
B Add type hints to a function typing type hinting annotations
B A countdown generator generators
B Validate a license key bool regular expressions
B Create a sandwich decorator decorators
B Swap case pybites characters string manipulation looping string parsing
B Where are the emojis? regular expressions looping emojis list comprehensions list
B Write tests for fibonacci fibonacci pytest
B Test print / standard output stdout list comprehensions capfd capsys pytest
B Global vs local variables sum global
B Extract users dict from a multiline string string parsing dict
B Print names to columns modulo f-strings print
B Pickling objects data wrangling pickle serialization
B Decode base64 encoded data base64 encode decode
B Reading progress datetime numbers
B Fastapi hello world FastAPI
B A little detour: pydantic Pydantic FastAPI
B Which words can you type with one hand? comparison set enum
I Word values sum Scrabble max
I Top 10 pybites tags xml Counter
I Pybites die hard generators file processing Counter namedtuple
I Parsing dates from logs file processing datetime
I Palindromes reverse list comprehensions algorithms max
I Practice exceptions exception handling raise
I Write a user validation function exception handling classes namedtuple
I Convert dict to namedtuple/json json dict namedtuple
I Generate a table of n sequences generators zip
I Form teams from a group of friends itertools
I Find the most common word data analysis Counter list comprehensions
I Write a decorator with argument decorators
I No promo twice, keep state in a class exception handling properties classes
I Parse omdb movie json data movie data json APIs glob
I Converting date strings to datetimes datetime findall Counter
I Movie data analysis data analysis mean defaultdict movie data sorting namedtuple
I Transpose a data structure zip dict
I Having fun with heapq datetime heapq
I Having fun with *args and **kwargs args function arguments kwargs
I Calculate the total duration of a course datetime numbers findall timedelta
I Write a login_required decorator decorators functools
I Write a new password field validator string module re
I Make a bar chart of new safari books data analysis bar chart
I Scrape packt's html with beautifulsoup beautifulsoup requests namedtuple
I When does python 2 die on planet miller? datetime
I Create a simple calculator that receives command line arguments reduce argparse functools
I Create a multiplication table class of variable length exception handling numbers dunder methods classes
I Create a deck of uno cards namedtuple list list comprehensions
I Data structures matter - speed up your python code performance data structures
I Get all valid dictionary words for a draw of letters itertools set Scrabble
I Create your own iterator iterators random
I Keep state in a class + make its instance callable dunder methods classes
I Retrieve the right ninja belt based on score OrderedDict itertools
I Organize a meeting between timezones (pytz) timezones pytz
I Find programmers with common languages set set operations
I Parse a csv file and create a bar chart bar chart requests csv community
I Filter and order tweets by polarity values TextBlob Twitter namedtuple
I Define a score enum and customize it adding methods classmethod enum __str__
I Flatten lists recursively (droste bite) recursion list
I Create a rgb-to-hex converter string formatting
I Playing with lists and dicts data structures list dict
I What south park characters talk most? data analysis Counter requests csv defaultdict
I Humanize a datetime datetime namedtuple
I Subclass the dict built-in classes inheritance
I Beautifulsoup ii - scrape us holidays beautifulsoup dict defaultdict
I Write an infinite sequence generator generators itertools string module zip
I Use the ipinfo api to lookup ip country mock.patch json requests APIs
I Filter words with non-ascii characters ascii all ord unicode
I List and filter files in a directory generators glob os module
I List exercise: return first occurrence indices of duplicated words counting set list comprehensions
I Xmas tree generator range string formatting default args join
I Write a numbers validation decorator decorators
I Check if two words are anagrams string matching anagram
I Find the user with most friends sorting looping tuples defaultdict
I Get the most recommended books default args beautifulsoup Counter list comprehensions requests
I Return the right ordinal suffix for a number modulo numbers string manipulation dict
I Analyze stock data counting data analysis string manipulation requests json sorting
I Find the word with the most vowels lambda string matching counting list comprehensions
I Sort a list of book objects lambda operator datetime attrgetter list sorting namedtuple
I Oop fun at the zoo classmethod itertools classes __str__
I Pybites first pandas bite data analysis csv pandas
I Exception handling: calculate the winning player exception handling numbers namedtuple
I Calculate the number of months passed datetime exception handling dateutil
I Rhombus generator string formatting format f-strings
I 100 weekdays of code date range datetime dateutil
I Print car data grouped by manufacturer operator data structures itertools sorting
I Turn messy csv into json re string manipulation csv pandas json
I Write your own data class data structures type hinting dataclasses hashable sorting
I Split a string by spaces or quoted text string manipulation split
I Make an index of story characters enumerate string matching collections defaultdict sorting
I Filter out accented characters string matching unicode
I Create a simple calculator operator exception handling numbers
I Vertically align output of counters string formatting
I Which packages were upgraded? comparison numbers string manipulation dict
I Complete a tox ini file parser class configparser tox properties classes string parsing string matching
I Set up future notifications datetime timedelta findall f-strings
I Find missing dates datetime pandas dateutil
I Parse pybites blog git commit log string parsing data analysis Counter datetime dateutil
I Parse a bunch of quotes from html string manipulation regular expressions string parsing dict
I Analyze some bite stats data data analysis set csv Counter
I Create a simple spelling suggester SequenceMatcher string matching difflib
I Calculate number of books to have read at date ... datetime exception handling dateutil
I Actor/actress age at movie release dataclasses f-strings dateutil
I Parse income distribution from latin america xml xml data analysis defaultdict
I Starwars character with highest bmi operator string manipulation tuple unpacking max
I Most upvoted stackoverflow python questions beautifulsoup string matching web scraping requests sorting
I Add caching to a fibonacci function performance fibonacci cache functools
I Analyze nba data with sqlite3 databases data analysis SQL sqlite3
I What date is mother's day celebrated? datetime dateutil
I Multiple inheritance (__mro__) multiple inheritance __mro__ classes inheritance
I Analyze some bite stats data - part ii data analysis sorting csv
I Female speakers @ pycon us beautifulsoup counting gender_guesser data wrangling
I Suppressing exceptions context managers exception handling
I Capture stdout context managers StringIO
I Bite notification planner generators datetime
I Parse best selling lists using the ny times api json mock requests APIs
I Split an iterable in groups of size n generators iterators itertools looping
I Unix file permissions string manipulation dict list comprehensions
I Get top titles from news.python.sc string parsing beautifulsoup news web scraping requests sorting namedtuple
I Convert warcraft json data to csv json exception handling csv
I Create a gravatar url string formatting hashlib gravatar
I Thumbs up for operator overloading exception handling classes emojis dunder methods operator overloading
I Analyze gold prices comparison string parsing data analysis looping pandas sorting
I Make a zipfile of the latest log files pathlib datetime zipfile os module
I Capitalize sentences string matching string manipulation regular expressions string parsing
I Which bite has the fastest tests? sorting string parsing type casting
I User experience matters! suggest matching files pathlib files difflib
I Test fizzbuzz fizzbuzz pytest
I Make mutpy's output more digestible data wrangling string parsing looping string matching mutpy
I Mocking a standard library function pytest random mock.patch
I Get all class names from a module inspect list comprehensions
I Get the most common email domains string parsing Counter web scraping set requests
I Find the fastest speech string manipulation datetime sorting
I Scoring objects typing builtins keyword importlib
I Alternative constructors classmethod classes
I More logging practice logging exception handling
I To rent or to stream movies? typing datetime collections dict
I Sortable dataclasses and enums dataclasses sorting dunder methods enum
I Create food objects FastAPI
I Retrieve food objects FastAPI
I Update and delete food objects FastAPI
I Pydantic part ii Pydantic FastAPI
I Food logging crud FastAPI
I Fastapi exception handling FastAPI
I Return an html response FastAPI
I Writing better spanish ascii unicode dict unicodedata
I Get spelling suggestions typing TextBlob comparison tuple unpacking namedtuple
A Regex fun re findall regular expressions
A Enrich a class with dunder methods dunder methods properties functools
A Write a context manager operator overloading context managers dunder methods with statement
A Find words that are > 95% similar file processing findall difflib SequenceMatcher itertools
A Abc's and class inheritance abstractmethod ABCs classes inheritance
A Building a karma app - implement the user class properties classes dunder methods operator overloading namedtuple
A Number guessing game class random games classes
A Make a little pybites search engine (feedparser) list comprehensions feedparser any search namedtuple
A Convert text into multiple columns string manipulation
A Using argparse to interface with a grocery cart argparse
A Create a variable size paw patrol card deck with random actions itertools random string module namedtuple
A Use an infinite iterator to simulate a traffic light iterators itertools namedtuple
A Regex fun - part ii re regular expressions
A Parse unix cal to a weekday mapping re Unix zip
A The singledispatch countdown challenge singledispatch decorators functools
A Write a score property properties classes
A Write a performance monitoring context manager context managers Counter
A Rock-paper-scissors and generator's send random games coroutines
A Parse pycon talk data from youtube list comprehensions namedtuple max
A Social media username validator typing re regular expressions string manipulation range string matching namedtuple
A Determine the strength of a password string matching re
A Marvel data analysis sum rounding data analysis Counter list comprehensions csv
A The emoji (unicode) bite unicode emojis sys
A Calculate a coding streak in days datetime string manipulation timedelta
A Manipulate string decorator kwargs string manipulation decorators list
A Subclass the list built-in exception handling properties dunder methods mean inheritance operator overloading list statistics median
A 15-way rock paper scissors exception handling games csv dict
A Cli tool: html link converter (stdin to stdout) data wrangling exception handling html stdin string formatting string manipulation sys
A Analyze mcdonald's food data data analysis pandas
A Make a terminal spinner animation stdout itertools command line time sys
A Use pandas to find most common genres in a movie excel sheet data cleaning excel groupby pandas movie data
A Strip comments from python code regular expressions string parsing comments
A Analyze sales data with pandas data analysis pandas groupby
A Create a js-like dict object javascript classes dict inheritance
A Calculate my mac's longest uptime data wrangling datetime string parsing dateutil
A Write a retry decorator exception handling decorators
A Code a translation fixer regular expressions
A Parse an email header regular expressions
A Analysing @pythonbytes rss feed regular expressions classes max min Counter string matching feedparser type hinting namedtuple
A Get sentences from a text data wrangling string manipulation regular expressions
A Get the dates ninja belts were earned looping datetime pandas json sorting
A Write tests for an account class pytest classes
A Zodiacal data parsing datetime pytest fixtures
A Test a number guessing game exception handling classes games mock.patch pytest
A Test a movie db class classes fixtures SQL sqlite3 movie data pytest
A Get father's days by date and country string manipulation string parsing dateutil
A Convert dict keys to snake case string manipulation recursion algorithms
A Fastapi authentication with jwt (json web tokens) FastAPI