How do I create a Python set with only one element? March 5, 2023 by Tarik In 2.7 as well as 3.x, you can use: mySet = {'abc'}