xFactorSchool.com(Beta)
How to Do Examples
Python Examples
HTML Examples
Code Examples
C Code Examples
C++ Code Examples
C# Code Examples
Java Code Examples
Python Code Examples
HTML Code Examples
CSS Code Examples
JavaScript Code Examples
Online Editor
C Code Editor
C++ Code Editor
C# Code Editor
Java Code Editor
Python Code Editor
HTML Code Editor
CSS Code Editor
JavaScript Code Editor
Practice how to create a set in Python
Python Online Editor
Execute Code
More Python Sample Codes
#create a set fruits = {"Apple", "Banana", "Cherry"} print("This is a set.") print(fruits) # add a fruit to the set fruits.add("Orange") print("\nLoop through the set.") #loop through the set for fruit in fruits: print(fruit) #remove a fruit fruits.remove("Apple") print("Loop through the set after removing Apple\n") #again loop through the set for fruit in fruits: print(fruit)