If a is a set, how do you check if variable b exists 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
14669 visits
Outline:What are sets in python? Input sets Create sets How to create empty sets? Operations on sets Add and remove methods Union and intersection methods Difference and symmetric_difference methods Subset and superset Length and containership on sets
What are sets in python? Input sets Create sets How to create empty sets? Operations on sets Add and remove methods Union and intersection methods Difference and symmetric_difference methods Subset and superset Length and containership on sets
Show video info
Pre-requisite