Here’s a code snippet showing the example code used in this lesson:
guest = "Peter"
# Bad: Repeated code
# if guest == "Mia" or guest == "John" or guest == "Linda":
# print("yay!")
# Good: DRY
friends = ["Mia", "John", "Linda", "Peter"]
if guest in friends:
print("yay!")