I always like to see cultural references in the learning materials.
Who’s the Tears for Fears fan that created this part of the Classes, Constructors modules? (it’s part of the updated content)
See:
class Shouter:
def __init__(self, phrase):
# make sure phrase is a string
if type(phrase) == str:
# then shout it out
print(phrase.upper())
shout1 = Shouter("shout")
# prints "SHOUT"
shout2 = Shouter("shout")
# prints "SHOUT"
shout3 = Shouter("let it all out")
# prints "LET IT ALL OUT"
Nicely done!