Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
python_devs = {"Alice", "Bob", "Carol"} js_devs = {"Bob", "Dave", "Carol"} both = python_devs & js_devs print("Both:", both) # Bob, Carol only_py = python_devs - js_devs print("Python only:", only_py) all_devs = python_devs | js_devs print("Total:", len(all_devs))
Result
Open