You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
printlen(hll) # 1 as items aren't added more than once
19
+
print(len(hll)) # 1 as items aren't added more than once
20
20
hll.add("hello again")
21
-
printlen(hll) # 2
21
+
print(len(hll)) # 2
22
22
23
23
If we add a further 1000 random strings (giving a total of 1002 strings) we'll have a count roughly within 1% of the true value, in this case it counts 1007 (within +/- 10.2 of the true value)
24
24
25
-
::
25
+
.. code-block:: python
26
26
27
27
# add 1000 random 30 char strings to hll
28
28
import random
29
29
import string
30
30
[hll.add("".join([string.ascii_letters[random.randint(0, len(string.ascii_letters)-1)] for n inrange(30)])) for m inrange(1000)]
0 commit comments