Python253

ipp1_3_first_middle_last

May 31st, 2024 (edited)
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.66 KB | None | 0 0
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. # Filename: ipp1_3_first_middle_last.py
  4. # Version: 1.0.0
  5. # Author: Jeoi Reqi
  6.  
  7. """
  8. Description:
  9.    - This script demonstrates the additional practice project to include a silly middle name using "Chapter 1: Project #1 - Silly Name Generator" from the book "Impractical Python Projects" by Lee Vaughan.
  10.    - The script generates humorous pseudonyms by combining random first names, middle names, and last names.
  11.    - It utilizes the random module to select names from predefined lists.
  12.  
  13. Requirements:
  14.    - Python 3.x
  15.    - The following modules:
  16.        - sys
  17.        - random
  18.  
  19. Functions:
  20.    - generate_funny_name():
  21.        Generates a humorous pseudonym by combining a random first name, middle name, and last name.
  22.  
  23. Usage:
  24.    - Ensure you have Python 3.x installed on your system.
  25.    - Save the script to a file, for example, `funny_name_generator.py`.
  26.  
  27. Running the Script:
  28.    - Open a terminal or command prompt.
  29.    - Navigate to the directory where the script is saved.
  30.    - Run the script using the command: python funny_name_generator.py.
  31.  
  32. Output:
  33.    - Upon running the script, a humorous pseudonym will be generated and printed to the console.
  34. """
  35.  
  36. import random
  37. import sys
  38.  
  39. # Lists of first, middle, and last names
  40. first_names = ['Baby Oil', 'Bad News', 'Big Burps', "Bill 'Beenie-Weenie'", "Bob 'Stinkbug'", 'Bowel Noises', 'Boxelder', "Bud 'Lite'", 'Butterbean', 'Buttermilk', 'Buttocks', 'Chad', 'Chesterfield', 'Chewy', 'Chigger', "Cinnabuns", 'Cleet', 'Cornbread', 'Crab Meat', 'Crapps', 'Dark Skies', 'Dennis Clawhammer', 'Dicman', 'Elphonso', 'Fancypants', 'Figgs', 'Foncy', 'Gootsy', 'Greasy Jim', 'Huckleberry', 'Huggy', 'Ignatious', 'Jimbo', "Joe 'Pottin Soil'", 'Johnny', 'Lemongrass', 'Lil Debil', 'Longbranch', '"Lunch Money"', 'Mergatroid', '"Mr Peabody"', 'Oil-Can', 'Oinks', 'Old Scratch', 'Ovaltine', 'Pennywhistle', 'Pitchfork Ben', 'Potato Bug', 'Pushmeet', 'Rock Candy', 'Schlomo', 'Scratchensniff', 'Scut', "Sid 'The Squirts'", 'Skidmark', 'Slaps', 'Snakes', 'Snoobs', 'Snorki', 'Soupcan Sam', 'Spitzitout', 'Squids', 'Stinky', 'Storyboard', 'Sweet Tea', 'TeeTee', 'Wheezy Joe', "Winston 'Jazz Hands'", 'Worms']
  41. middle_names = ['Alfred', 'Bartholomew', 'Biscuit', 'Boo Boo', 'Bubbles', 'Candyfloss', 'Cheesecake', 'Cupcake', 'Cuthbert', 'Digory', 'Dingleberry', 'Dorkface', 'Dumpling', 'Ephraim', 'Ferdinand', 'Fiddlesticks', 'Fluffernutter', 'Fuzzy', 'Gideon', 'Giggle', 'Goofball', 'Gumdrop', 'Honeybee', 'Humphrey', 'Ignatius', 'Jedediah', 'Jellybean', 'Jiggle', 'Klaus', 'Kookaburra', 'Lazarus', 'Lemon', 'Lollipop', 'Marshmallow', 'Merryweather', 'Montague', 'Muffin', 'Nettle', 'Noodle', 'Nugget', 'Obadiah', 'Peaches', 'Percival', 'Pickle', 'Pudding', 'Quentin', 'Reginald', 'Rosenblaut', 'Sillypants', 'Simeon', 'Snoozer', 'Sprinkles', 'Squiggle', 'Thaddeus', 'Tiddlywinks', 'Tootsie', 'Twinkle', 'Uriah', 'Valentin', 'Waffle', 'Waldo', 'Whippersnapper', 'Xerxes', 'Yancy', 'Zebulon', 'Zigzag']
  42. last_names = ['Appleyard', 'Bigmeat', 'Bloominshine', 'Boogerbottom', 'Breedslovetrout', 'Butterbaugh', 'Clovenhoof', 'Clutterbuck', 'Cocktoasten', 'Endicott', 'Fewhairs', 'Gooberdapple', 'Goodensmith', 'Goodpasture', 'Guster', 'Henderson', 'Hooperbag', 'Hoosenater', 'Hootkins', 'Jefferson', 'Jenkins', 'Jingley-Schmidt', 'Johnson', 'Kingfish', 'Listenbee', "M'Bembo", 'McFadden', 'Moonshine', 'Nettles', 'Noseworthy', 'Olivetti', 'Outerbridge', 'Overpeck', 'Overturf', 'Oxhandler', 'Pealike', 'Pennywhistle', 'Peterson', 'Pieplow', 'Pinkerton', 'Porkins', 'Putney', 'Quakenbush', 'Rainwater', 'Rosenthal', 'Rubbins', 'Sackrider', 'Snuggleshine', 'Splern', 'Stevens', 'Stroganoff', 'Sugar-Gold', 'Swackhamer', 'Tippins', 'Turnipseed', 'Vinaigrette', 'Walkingstick', 'Wallbanger', 'Weewax', 'Weiners', 'Whipkey', 'Wigglesworth', 'Wimplesnatch', 'Winterkorn', 'Woolysocks']
  43.  
  44. def generate_funny_name():
  45.     """
  46.    Generates a humorous pseudonym by combining a random first name, middle name, and last name.
  47.    
  48.    Returns:
  49.        str: A randomly generated pseudonym.
  50.    """
  51.     first_name = random.choice(first_names)
  52.     middle_name = random.choice(middle_names)
  53.     last_name = random.choice(last_names)
  54.     return f"\n{first_name} {middle_name} {last_name}"
  55.  
  56. if __name__ == "__main__":
  57.     print("Welcome to the Funny Name Generator!\n")
  58.     print("Generating a humorous pseudonym...\n")
  59.    
  60.     while True:
  61.         funny_name = generate_funny_name()
  62.         print(funny_name, file=sys.stderr)
  63.         print("\n")
  64.         try_again = input("Press [Enter] to try again. (or.. type '0' to Exit):")
  65.         if try_again.lower() == "0":
  66.             print("\nExiting Program...   GoodBye!\n")
  67.             break
  68.  
Add Comment
Please, Sign In to add comment