Skip to content

Instantly share code, notes, and snippets.

@nohe427
Created May 30, 2014 14:24
Show Gist options
  • Save nohe427/41dd85069c9e0048a400 to your computer and use it in GitHub Desktop.
Save nohe427/41dd85069c9e0048a400 to your computer and use it in GitHub Desktop.
uniqueRandomNumbers
import random
L = [0]
def nohe(x):
global L
x = 0
while x in L:
x = random.choice(range(1, 361))
L.append(x)
return x
@nohe427
Copy link
Author

nohe427 commented Nov 25, 2015

import random 
L = [0] 
def nohe(x): 
  global L 
  x = 0 
  while x in L: 
    x = random.choice(range(1, 361)) 
  L.append(x)
  return x 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment