Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
f-strings solution in Clear category for Party Invitations by David_Jones
class Friend:
def __init__(self, name):
self.name = name
self.last_invitation = 'No party...'
def show_invite(self):
return self.last_invitation
class Party:
def __init__(self, place):
self.place = place
self.friends = set()
def add_friend(self, friend):
self.friends.add(friend)
def del_friend(self, friend):
self.friends.remove(friend)
def send_invites(self, time):
for friend in self.friends:
friend.last_invitation = f'{self.place}: {time}'
May 16, 2019