8. Write a python program to print out the names which exists in the first name list but not exist in the second set of name list as same answer in the following output.
The output is:
name_list_1= "Mark", "Nicole", "Jason", "Howard"
name_list_2= "Nicole", "Howard"
Answer: The names which exists in the first name list but not exist in the second set of name
list : {'Jason', 'Mark'}
Answer:
name_list_1 = set(["Mark", "Nicole", "Jason", "Howard"]) name_list_2 = set(["Nicole", "Howard"]) print("The names which exist in the first name list but not exist in the second set of name list :", name_list_1.difference(name_list_2))
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)