I have the following list of people I would like to invite for dinner:
guests = ["Ava Lovelace", "Epictetus", "Buddha", "Einstein"]
I would like to send an invite to each of them, but without mentioning their own name in the invite. Here is what I tried (and got an error):
for i in guests:
print (f"{i}, would you like to have dinner together? The following people received an invitation:", guests.replace("{i}"), "you")
The replace function doesn't exist for lists in python. You could try a list comprehension instead: