BANK UPDATED 2026 WITH 15 VERIFIED
QUESTIONS AND ANSWERS
⩥ Returns the number of characters in a text string. Answer: Len()
⩥ unordered collection of unique elements.
• Elements are unordered: Elements in the set do not have a position or
index.
• Elements are unique: No elements in the set share the same value..
Answer: Set()
⩥ set.add(value)
Ex: my_set.add('abc'). Answer: How to add elements to a set?
⩥ set.pop()
Ex: my_set.pop(). Answer: How to remove random item from a set?
⩥ set.remove(value)
, Raises KeyError if value is not found.
Ex: my_set.remove('abc'). Answer: How to remove item from a set?
⩥ set1.update(set2)
Adds the elements in set2 to set1.. Answer: How to add items from one
set to another set?
⩥ set.clear(). Answer: How to clear all elements from a set?
⩥ Returns a new set containing only the elements in common between
set and all provided sets.. Answer: set.intersection()
⩥ Returns a new set containing all of the unique elements in all sets..
Answer: set.union()
⩥ Returns a set containing only the elements of set that are not found in
any of the provided sets.. Answer: set.difference()
⩥ Returns a set containing only elements that appear in exactly one of
set_a or set_b.. Answer: set_a.symmetric_difference