Skip to main content
2 of 6
added syntax highlighting
ETHproductions
  • 50.1k
  • 6
  • 94
  • 240

#Python, 43 bytes#

import random
lambda n:1>random.random()*n

50 bytes if function is named:

import random
def f(n):return 1>random.random()*n
DuhHello
  • 499
  • 1
  • 4
  • 5