#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
#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