11 randomly generates a phone number, python achieve

Random Import 


# randomly generates a phone number
DEF get_phone ():
L = ""
head = [132,185,186]
index the random.randint = (0, 2)
L = L + STR (head [index])
for I in Range (. 8) :
tail the random.randint = (0,9)
L = L + STR (tail)
return L

Number = get_phone ()
Print (Number)

Guess you like

Origin www.cnblogs.com/nothingc/p/12031468.html