Advertisement
ainumortis

generador de nombres

Feb 8th, 2014
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. def Nombre():
  2. import random
  3. n= random.randint(1,4)
  4. if n == 1:
  5. a= random.choice(lista)
  6. print a
  7. if n== 2:
  8. a= random.choice(lista)
  9. b= random.choice(lista)
  10. print a+b
  11. if n== 3:
  12. a= random.choice(lista)
  13. b= random.choice(lista)
  14. c= random.choice(lista)
  15. print a+b+c
  16. if n== 4:
  17. a= random.choice(lista)
  18. b= random.choice(lista)
  19. c= random.choice(lista)
  20. d= random.choice(lista)
  21. print a+b+c+d
  22. else:
  23. print"Esto funciona mal"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement