Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. from random import randint
  2. def esta_na_lista(l,n):
  3.   for item in l:
  4.     if(item == n):
  5.       return True
  6.   return False
  7.  
  8. L = []
  9. i = 0
  10.  
  11. while i < 500:
  12.   numero = randint(100000,599999)
  13.   while esta_na_lista(L,numero):
  14.      numero = randint(100000,599999)
  15.  
  16.   L.append(numero)
  17.  
  18. for item in L:
  19.   print(item)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement