import
random
print
(random.random())
print
(random.randint(
1
,
2
))
print
(random.randrange(
1
,
10
))
#验证码例子
def id_code(): import random date = "" for p in range(4): i = random.randrange(0, 4) if i == 0 or i == 3: k = random.randrange(0, 10) date = date + str(k) else: j = random.randrange(65, 91) date = date + chr(j) return date if __name__ == '__main__': print(id_code())