+ 2

How can you get the size of a set?

14th Jun 2018, 3:07 PM
Israel Emmanuel
Israel Emmanuel - avatar
4 odpowiedzi
+ 2
Please mentions the language. In case you're talking about Python, >>> my_set = {1, 1, 2, 3, 5} >>> len(my_set) 4
14th Jun 2018, 3:25 PM
Just A Rather Ridiculously Long Username
+ 1
>>> a={1,2,3,4,5,6,7} >>> len(a) 7
14th Jun 2018, 3:23 PM
Gopal Gautam
Gopal Gautam - avatar
+ 1
len(s) Return the length (the number of items) of an object. The argument may be a sequence (such as a string, bytes, tuple, list, or range) or a collection (such as a dictionary, set, or frozen set).
14th Jun 2018, 5:12 PM
$¢𝐎₹𝔭!𝐨𝓝
$¢𝐎₹𝔭!𝐨𝓝 - avatar
0
Thank you for your help... I finally figured it out. 😀
14th Jun 2018, 3:26 PM
Israel Emmanuel
Israel Emmanuel - avatar