4. Write a python program to add more than one item into set_a which provided in the following output.
The output is:
set_a = set(['Python', 'Free', 'Exercises', 'Tutorials', 'Sets', 'Library'])
add two items: 'Answer' and 'List'
Expected Answer:
After adding new items 'Answer' and 'List' is: {'Free', 'Python', 'List', 'Sets', 'Library',
'Exercises', 'Tutorials', 'Answer'}
Sample Answer :
set_a = set(['Python', 'Free', 'Exercises', 'Tutorials', 'Sets', 'Library']) set_a.update(["Answer", "List"]) print("After adding new items 'Answer' and 'List' is:", set_a)
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)