Respuesta :
Answer:
The code is given below in Python with appropriate comments
Explanation:
# convert list to set
male_names = set(['Oliver','Declan','Henry'])
# get remove and add name from user
remove_name = input("Enter remove name: ")
add_name = input("Enter add name: ")
# remove name from set
male_names.remove(remove_name)
# add new name ij set
male_names.add(add_name)
# sort the set
a = sorted(male_names)
# print the set
print(a)
The program which performs the stated instruction is written in python 3 thus ;
pop_names = set(['Oliver', 'Declan', 'Henry'])
#set of popular names
rem_name = input('Enter name to remove : ')
#input for name to remove
add_name = input("Enter name to add : ")
#replacement for removed name
pop_names.remove(rem_name)
pop_names.add(add_name)
print(pop_names)
#display the names.
A sample run of the program is attached.
Learn more : https://brainly.com/question/12483071
