An alternative
Return a list from the function.
Use the function as an iterable in a for
for
def pets(): pets_list = ['dog','cat'] return pets_list for i in pets(): print(f'I love my {i}')