python random
随机数
import random
print random.random()
print random.randrange(1,10)
print random.randint(1,10)
验证码
import random
checkcode=''
for i in range(1,5):
if i==random.randint(1,4):
temp=chr(random.randint(65,121))
else:
temp=random.randint(1,9)
checkcode+=str(temp)
print checkcode