The way to create an empty mutable set is :
A. s = set()
There's a string ’10111100’, be set(‘10111100’) As the result of the :
C. {‘0’, ‘1’}
The way to add elements to a collection is :
B. s.add(x)
s.remove(x) and s.discard(x) From the collection s Delete element x, The difference between them is :
B. x In collection s In the absence of , Use s.discard(x) No exception is fired
Python The mapping type in refers to :
C. Dictionaries
A collection is a collection of elements placed in {} Data types separated by commas in , About set , The correct choice below is :
A. Elements in a collection are unordered
B. There are no duplicate elements in the collection
C. The elements in the collection are immutable data types
D. Data in a mutable set can be added and deleted
The method to create an empty dictionary is :
A. d = dict() print(d)
C. d = {} print(d)
Methods to remove elements from a collection are
A. s.pop(x)
B. s.discard(x)
C. s.clear()
D. s.remove(x)
The following options can return a set s and t The set of all elements in is :