The top 3 most popular male names of 2017 are Oliver, Declan, and Henry according to babynames.

1. Write a program that modifies the male_names set by removing a name and adding a different name. Sample output with inputs: 'Oliver' 'Atlas' { 'Atlas', 'Declan', 'Henry' }

NOTE: Because sets are unordered, the order in which the names in male_names appear may differ from above.

Respuesta :

Answer:

#Set of three most popular names in 2007

male_names =  {'Oliver', 'Declan', 'Henry'}

#The male_names set is displayed to the user

print(male_names)

#The name to be removed is accepted from the user as a string

remove_name = str(input("Enter name to remove: "))

#The name to be added is accepted from the user as a string

add_name = str(input("Enter name to add: "))

#The remove method of a set is use to remove the received remove_name

male_names.remove(remove_name)

#The add method of a set is use to add the received add_name

male_names.add(add_name)

#The new set of male_names is displayed to the user

print(male_names)

Explanation: