fork(2) download
  1. import random
  2.  
  3. r = random.SystemRandom()
  4. s = "some string"
  5. print(r.choice(s)) # print random character from the string
  6. print(s[r.randrange(len(s))]) # same
Success #stdin #stdout 0.09s 10992KB
stdin
Standard input is empty
stdout
m
n