Respuesta :
Answer:
Following are the program in the Python Programming Language.
male_names = {'kay', 'Dev', 'Sam', 'Karan', 'Broly', 'Samuel', 'Jayd', 'Lucifer', 'Amenadiel', 'Anmol'}
female_names = {'Kally', 'Megha', 'Lucy', 'Shally', 'Bailey', 'Jayd', 'Anmol', 'Beth', 'Veronica', 'Sam'}
#initialize the union from male_names and female_names
all_names = male_names.union(female_names)
#Initialize the similar names from male_names and female_names
neutral_names = male_names.intersection(female_names)
#initialize the symmetric_difference from male_names and female_names
specific_names = male_names.symmetric_difference(female_names)
#print the results
print(sorted(all_names))
print(sorted(neutral_names))
print(sorted(specific_names))
Output:
['Amenadiel', 'Anmol', 'Bailey', 'Beth', 'Broly', 'Dev', 'Jayd', 'Kally', 'Karan', 'Lucifer', 'Lucy', 'Megha', 'Sam', 'Samuel', 'Shally', 'Veronica', 'kay']
['Anmol', 'Jayd', 'Sam']
['Amenadiel', 'Bailey', 'Beth', 'Broly', 'Dev', 'Kally', 'Karan', 'Lucifer', 'Lucy', 'Megha', 'Samuel', 'Shally', 'Veronica','kay']
Explanation:
The following are the description of the program.
- In the above program, firstly we set two list data type variables 'male_names' and 'female_names' and initialize the male and female names in those variables.
- Then, we set three variables in which we store union, intersection, and symmetric differences and finally print these three variables in a sorted manner.