0
Please explain this:
l = {1,2,5,6,1,2,4,6,1} t = tuple(l) Print(t.count(1))
4 ответов
+ 1
So the number of times we insert any number(same) doesn't matter it always stores as a single quantity?
+ 1
Okk thanks I understood.
0
l is of type set and stores each number only once.
0
You should make your questions a bit more clear. I just guess you are wondering why you get output 1?
You have a set (l), so each value can be part once or not at all. So when you count the occurence in the created tuple (t) it will return just 0 or 1.