#!/usr/bin/env python
import random
print(random.random())
print(random.randint(1,3))#0-3
print(random.randrange(3))#0-2
print(random.choice('abcdef'))#
print(random.sample('abcdefgh',2))
print(random.uniform(1,3))#浮点
a = [1,2,3,4,5,6,7]
print(random.shuffle(a))#打乱
print(a)
print("-------------------")
checkcode=''
for i in range(4):
#current=random.randint(0,9)
#current = random.sample('0123456789abcdefghijk',1)
current = random.randrange(0,4)
if current == i:
tmp=chr(random.randint(65,90))
else:
tmp = random.randint(0,9)
checkcode += str(tmp)
print(checkcode)
#!/usr/bin/env python
import random
print(random.random())
print(random.randint(1,3))#0-3
print(random.randrange(3))#0-2
print(random.choice('abcdef'))#
print(random.sample('abcdefgh',2))
print(random.uniform(1,3))#浮点
a = [1,2,3,4,5,6,7]
print(random.shuffle(a))#打乱
print(a)
print("-------------------")
checkcode=''
for i in range(4):
#current=random.randint(0,9)
#current = random.sample('0123456789abcdefghijk',1)
current = random.randrange(0,4)
if current == i:
tmp=chr(random.randint(65,90))
else:
tmp = random.randint(0,9)
checkcode += str(tmp)
print(checkcode)