containership
Title
Question
If a is a set, how do you check if variable bexists in a?
Here, the answer is,
b in a
But it has been mentioned that b is a variable and not an element of a. So, in that case the answer that has been provided in the tutorial is wrong. It should be,
b<=a
Python-3.4.3 Sets-in-Python 10-11 min 20-30 sec
Answers:
b in a checks if the value referenced by variable b is also available in the iterable a.
Please specify your question, so that we can help you.
Login to add comment