Skip to main content
Commonmark migration
Source Link

#Python, 42 bytes#

Python, 42 bytes

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

Edit: Removed the time.time() answer because of the distribution.

#Python, 42 bytes#

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

Edit: Removed the time.time() answer because of the distribution.

Python, 42 bytes

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

Edit: Removed the time.time() answer because of the distribution.

deleted 65 characters in body
Source Link
DuhHello
  • 499
  • 1
  • 4
  • 5

#Python, 3642 bytes#

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

EditEdit: UsingRemoved the current time instead of randomtime.randomtime(), seven bytes are saved: answer because of the distribution.

import time
lambda n:1>time.time()%n

#Python, 36 bytes#

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

Edit: Using the current time instead of random.random(), seven bytes are saved:

import time
lambda n:1>time.time()%n

#Python, 42 bytes#

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

Edit: Removed the time.time() answer because of the distribution.

Removed name
Source Link
Adám
  • 31.1k
  • 3
  • 124
  • 287

#Python, 36 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

Edit: Using the current time instead of random.random(), seven bytes are saved:

import time
lambda n:1>time.time()%n

#Python, 36 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

Edit: Using the current time instead of random.random(), seven bytes are saved:

import time
lambda n:1>time.time()%n

#Python, 36 bytes#

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

Edit: Using the current time instead of random.random(), seven bytes are saved:

import time
lambda n:1>time.time()%n
update
Source Link
DuhHello
  • 499
  • 1
  • 4
  • 5
Loading
added syntax highlighting
Source Link
ETHproductions
  • 50.1k
  • 6
  • 94
  • 240
Loading
Source Link
DuhHello
  • 499
  • 1
  • 4
  • 5
Loading