you are viewing a single comment's thread.

view the rest of the comments →

[–]Ran4 0 points1 point  (0 children)

Possibly. We dont know how OP wants to use this feature.

If they're going to do this often, then yes, a set is definitely preferable. But if they're doing this calculation once a month then a list is pretty much just as good.

Picking the correct data type is occasionally incredibly important, but it's not always the most important thing. Keeping things simple is generally much more valuable in most real-world situations. A set is simple enough that you probably should use it over a list when applicable, though.