Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Set Vs Tuple In Python

myset = {"bananas", "apples", "cherries"}
mytuple = ("bananas", "apples", "cherries")
print(myset)
#outputs {'apples', 'cherries', 'bananas'}
print(mytuple)
#outputs ('bananas', 'apples', 'cherries')

myset = {2, 1, 3}
mytuple = (2, 1, 3)
print(myset)
#outputs {1,  2,  3}
print(mytuple)
#outputs (2, 1, 3)

 
PREVIOUS NEXT
Tagged: #Set #Vs #Tuple #In #Python
ADD COMMENT
Topic
Name
2+7 =