How to create and print a set of words in Python

2 Answers

0 votes
s = set(["python", "c++", "java", "php"])
print(s)


'''
run:
   
{'c++', 'java', 'python', 'php'}
 
'''

 



answered Jun 27, 2018 by avibootz
0 votes
s = set(["python", "c++", "java", "java", "php", "php"])
print(s)


'''
run:
   
{'c++', 'java', 'php', 'python'}
 
'''

 



answered Jun 27, 2018 by avibootz
...