Anonymous user
Entropy/Narcissist: Difference between revisions
m
Now it works with arbitary filename
(Added Kotlin) |
m (Now it works with arbitary filename) |
||
Line 440:
return -sum( count/lns * math.log(count/lns, 2) for count in p.values())
with open(
b=f.read()
print(entropy(b))</lang>
{{Output}}
<pre>4.
=={{header|Racket}}==
|