Guest User

Untitled

a guest
Dec 13th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. import random, string
  2.  
  3. vowels = 'aeiouy'
  4. consonants = 'bcdfhjklmnpqrstvwxz'
  5.  
  6. while True:
  7. try:
  8. cantLetras = int(input('Elige la cantidad de letras: '))
  9. cantVariantes = int(input('Eliga la cantidad variantes que desea: '))
  10. break
  11. except ValueError:
  12. print('Por favor introduzca una cantidad numérica')
  13.  
  14.  
  15.  
  16. def generator():
  17. name = ''
  18.  
  19. for i in range(cantLetras):
  20.  
  21. letter_input = input('Choose a letter... "v" for vowels, "c" for consonants, "l" for any other letter')
  22.  
  23. if letter_input == "v":
  24. letter = random.choice(vowels)
  25. elif letter_input == "c":
  26. letter = random.choice(consonants)
  27. elif letter_input == "l":
  28. letter = letter_input
  29. else:
  30. letter = letter_input
  31.  
  32. name += letter
  33.  
  34. print(name.capitalize())
  35.  
  36. def multi_generator():
  37. for x in range(cantVariantes):
  38. generator()
  39.  
  40. multi_generator()
Add Comment
Please, Sign In to add comment