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 get some more Python fundamentals in. If you find them too hard, we happily help you through our Introductory Bites Video Course or Pybites Developer Init (PDI) Coaching Program. Ready to start earning your first PyBites Ninja Belt?


Bite Tags More info /
forum

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 …

3.10 freebie f-strings

if/else

        0

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 …

3.10 break continue

freebie input mock.patch while

        0

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 …

3.10 dict freebie

looping

        0

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 …

3.10 freebie join

split

        0

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 …

3.10 freebie replace

slicing split string module strip

        0

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 …

3.10 counting freebie

regular expressions replace string manipulation Zen of Python

        0

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 …

3.10 freebie list comprehensions

modulo

        0

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. …

3.10 counting dict

freebie namedtuple

        0

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 …

3.10 dict exception handling

format freebie string manipulation ternary

        0

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 …

3.10 exception handling freebie

raise type casting

        0