The quiz where the difficulty automagically adapts to the player's Python knowledge
This is a question page. You can use this page to bookmark a question. Start a new quiz!
Question #724
The built-in method remove() removes an element from the set only if the element is present in the set. The discard() will produce the same output but if the element is not present in the set, then a KeyError exception will be thrown. (geeksforgeeks.org/python-remove-discard-sets)
Which set method will throw an exception if the item to be removed do not exist?
— The Python Quiz (@thepythonquiz) July 9, 2021
discard()
remove()
π Comment the answer, like and retweet! #python
Question difficulty: π΅π΅π΅π΅π΅
Similar questions: