Respuesta :
Answer:
Explanation:
The following Python code asks the user for inputs for the name to remove and add in the set. It then tries to remove the given name from the list. If it fails it prints out to the user saying that the name does not exist. If it does exist then it removes the name and adds the new name. Finally it prints out the current list of names.
male_names = {'oliver', 'Declan', 'Henry'}
name_to_remove = input("Enter name to remove: ")
name_to_add = input("Enter name to add: ")
try:
male_names.remove(name_to_remove)
male_names.add(name_to_add)
except:
print("Name that you are trying to remove does not exist")
print("List of Names: ")
print(male_names)

In this exercise we have to use the knowledge of the python language to write the code, so we have to:
The code is in the attached photo.
So to make it easier the code can be found at:
male_names = {'oliver', 'Declan', 'Henry'}
name_to_remove = input("Enter name to remove: ")
name_to_add = input("Enter name to add: ")
try:
male_names.remove(name_to_remove)
male_names.add(name_to_add)
except:
print("Name that you are trying to remove does not exist")
print("List of Names: ")
print(male_names)
See more about python at brainly.com/question/26104476
