Oct-26-2020, 05:39 PM
You use bbcode "python" tags around your code in the post to display properly. You can click the Python logo button above the editor to insert them automatically.
If you just need the size of the set, you don't have to convert it to a list.
If you just need the size of the set, you don't have to convert it to a list.
len()
works just fine on sets, so print(len(set(entry)))should be sufficient. If you don't need the ordering, you could just create
non_dup
as a set in the first place and then add objects to it (rather than append them).