Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. import random
  2. import sys
  3.  
  4. def main():
  5.  
  6. name = input("What is your name? ")
  7. num_adjectives = int(input("How many insults? "))
  8. num_nouns = int(input("How many nouns? "))
  9.  
  10. Adjective = set()
  11. Adjective.add("Dumb")
  12. Adjective.add("Insane")
  13. Adjective.add("Ugly")
  14. Adjective.add("Mouse")
  15. Adjective.add("Loser")
  16. Adjective.add("Elf")
  17.  
  18. if num_adjectives > 3:
  19. print('Error You Must Enter Number Between 1-3')
  20. sys.exit()
  21.  
  22. Nouns = set()
  23. Nouns.add("Weird")
  24.  
  25.  
  26. adjectives = random.sample(Adjective, num_adjectives)
  27. nouns = random.sample(Nouns,num_nouns)
  28.  
  29.  
  30. insults = ", ".join(adjectives)
  31. n = ", ".join(nouns)
  32.  
  33. print(name, "is a", insults, n) ## When everything is done generating, print out the final line (Name is a (1-3)
  34. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement