next() and count() method don't work.

Hon'able Python Team, I am learning python, and I was trying to build an algorithm that could count the recurrence of the items in a set at run-time, that is, counting the the number of occurrence in the set defined by the user, I tried using multiple next() and count() method. As next() method works only within the code, that is, it doesn't accept external values outside the loop, I tried using while loop, but still didn't get the desired output. I am using Python 3.7.2 and I am sending you screenshots as an attachment. Kindly look into the same and let me know. Thank You. Regards.

count the recurrence of the items in a set I am redirecting this to the python help list.
Your question is unclear since normally the word recurrence would imply two or more of the same item whereas a set has only one of each item. If you want to know how many items there are in a set use the len function, e.g. len(myset) As an aside when asking a question like this keep it simple: how do I determine the size of a set?
participants (2)
-
Anurag Sharma
-
Bob Gailer