Welcome to the PyBites Intro Bites

Login to code You are beyond the Python Newbie level (e.g. you know how to write a function, parse a string, etc.). Now it's time to code the 10 Free Intro Bites below. It's a great way to explore the platform and get some more Python fundamentals in. If you find them too hard, we happily help you through our Introductory Bites Video Course. Ready to start earning your first PyBites Ninja Belt?

Bite Tags More info /

Intro Bite 01. F-strings and a simple if/else

Welcome to our Intro Bites, it's time to gauge where you are with your Python! If you are still new …

f-strings if/else


Intro Bite 02. Infinite loop, input, continue and break

In this Bite we'll get you to take user input using the input builtin and see if it matches items …

break continue input

mock.patch while


Intro Bite 03. Loop through a dictionary and pluralise a word

You're given a dictionary of people and the number of games they've won. Use a for loop to iterate over …

dict looping


Intro Bite 04. Split and join

Split up the message on newline (\n) using the split builtin, then use the join builtin to stitch it together …

join split


Intro Bite 05. Slice and dice

Take the block of text provided and strip off the whitespace at both ends. Split the text by newline (\n).Loop …

replace slicing split

string module strip


Intro Bite 06. Strip out vowels and count the number of replacements

In this Bite we'd like you to loop over the characters in the large block of text (the most important …

counting regular expressions replace

string manipulation Zen of Python


Intro Bite 07. Filter numbers with a list comprehension

Complete the function below that receives a list of numbers and returns only the even numbers that are > 0 …

list comprehensions modulo


Intro Bite 08. Loop over a dict of namedtuples calculating a total score

In this Bite you calculate the total amount of points earned with Ninja Belts by accessing the given ninja_belts dict.You …

counting dict namedtuple


Intro Bite 09. Workout dictionary lookups

In this Bite you learn how to lookup values from a dictionary or in Python: dict. You are presented with …

dict exception handling format

string manipulation ternary


Intro Bite 10. Type conversion and exception handling

In this Bite you complete the divide_numbers function that takes a numerator and a denominator (the number above and below …

exception handling raise type casting


We use Python 3.8