Python Zero to Heros

Online Absolute Beginner Python Tutorials 

Every Sunday 2pm (UK time/ BST)

Get this slide deck:


Python objects - int, float, str, list, dict, bool

Control flows - if-else, for loop, while loop

Functions, modeuls, classes and decorators



Any Questions?

String Operations

Rrcap: "adding" two strings "+", f-strings

greeting = "Hello" + " " + "World"
more_greeting = f"Hey {greeting}! Do you want some tractor jokes?"

You can also use "join"

hello_list = ["Hello", "World"]
" ".join(hello_list)

How about breaking them?

String Operations

"what is www mean?".split('w')

Can I spint with multiple option? (Spoilor: Regex)

Other manipulations

"Hello World".lower()
"Hello World".upper()
"hello world".capitalize()
"!!!!!Yay it's Sunday!!".replace('!',' ')
"    Hello     ".strip()
"!!!!!Yay it's Sunday!!".strip('!')
"    Yay it's Sunday !!!  ".strip(" !")


What is Regex?

A regular expression (shortened as regex or regexp; also referred to as rational expression) is a sequence of characters that define a search pattern. - wikipedia



Whole Numbers – /^\d+$/

Common email Ids – /^([a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,6})*$/

Time Format HH:MM:SS 24-hour

import re

that_sentance = "There_are/lots#of_special/characters"


Replace a pattern

import re

that_sentance = "There_are/lots#of_special/characters"
re.sub("[_/#]"," ",that_sentance)


Searching for a pattern

import re

that_sentance = "There_are/lots#of_special/characters""[_/#]",that_sentance)"re",that_sentance)
>>> m = re.match(r"(\w+) (\w+)", "Isaac Newton, physicist")
>>>       # The entire match
'Isaac Newton'
>>>       # The first parenthesized subgroup.
>>>       # The second parenthesized subgroup.

You can also check the "span()"

Let's try writing some properties


Simple E-comerce similator (

Can you validate the user's email address?

Homework 📝


There is no homework :-)

Next week:
Mocking/ patching in Pytest

Sunday 2pm (UK time/ BST)

There are also Mid Meet Py every Wednesday 1pm

Testing month in June