First, line 3 doesn't create a set, but a dict as the error tells you. There isn't an empty set literal; if you want a set you have to use
In any case, appending doesn't make sense, because that means "adding to the end". Sets and dicts don't have the notion of order of items, so for a set you'd use the
set()
.In any case, appending doesn't make sense, because that means "adding to the end". Sets and dicts don't have the notion of order of items, so for a set you'd use the
add
method.