[Beginner Python lesson] The Jewnerator: Generate a 100% authentic true Jewish name that would make Noseberg Shekelman proud!

1    19 Feb 2019 14:37 by u/Teledildonicist

This is a beginning Python lesson inspired by the book, "Impractical Python Projects". Specifically, the very first lesson: Silly Name Generator. Except, in this lesson, we are going to be creating The Jewnerator, a program to generate an absolutely, 100% true-to-life Jewish name!

First, we 'import random', giving us the ability to choose a random value from our list of Jewish names.

Next, we define our tuples: One for first names, and another for last names. Feel free to modify these as desired; you can even make a 100% authentic Negroid name generator!

The 'while True:' loop is, essentially, an infinite loop, since Python's "True" value always evaluates to boolean true.

Inside the loop is where the magic happens. We create 4 variables, first_name{1, 2} and last_name{1, 2}, and then choose a random element from our 'first' and 'last' name tuples. We do this with the 'random' module's 'choice' method, passing our first and last name tuples as arguments.

After we select our random values, we print them. We use print's .format method to print out our newly created Jewish name. The '{}' symbols are positional place holders, filling in the value of our first_name1 variable, in the order the arguments are passed to the .format method.

After printing our 100% authentic Jewish name, we give the user a choice to continue or quit. 'input' is Python's way of accepting user input. In this case, try_again is assigned whatever value the user inputs at our prompt.

Then, we use an 'if' statement, using the 'lower()' method to ensure that the input is lowercase. We do this so that the user can type either a 'N' or a 'n' and it will work.

If the user chooses 'n', that is, they do not what to continue generating 100% authentic Jewish names, the 'break' command runs, "breaking" us out of our infinite while loop.

Finally, we give the user one more prompt, allowing them to, essentially, press any key to quit.

We have our completed code below. This is my favorite name: Shekel Banker Jew Nose

Enjoy!

  
  1 import random
  2
  3 print("The Jewnerator: Create a name to make Noseberg Shekelman proud.\n")
  4
  5 first = ('Nose', 'Jew', 'Shekel', 'Larry', 'Ron', 'David', 'Jay',
  6          'Goy', 'Goyim', 'Bank', 'Banker', 'Marty')
  7 last = ('Berg', 'Berger', 'Jew', 'Nose', 'Shekel', 'Shekels', 'Man',
  8         'Jew', 'Gold', 'Silver', 'Bronze', 'Bron', 'Stein', 'Finkle',
  9         'Bank', 'Banker', 'Goy', 'Goyim', 'Feld', 'Sein')
 10
 11 while True:
 12     first_name1 = random.choice(first)
 13     first_name2 = random.choice(first)
 14     last_name1 = random.choice(last)
 15     last_name2 = random.choice(last)
 16
 17     print("\n")
 18     print("{} {} {} {}".format(first_name1, last_name1,
 19                                first_name2, last_name2))
 20     print("\n")
 21
 22     try_again = input("\n\nTry again? (Press enter else n to quit)\n")
 23     if try_again.lower() == "n":
 24         break
 25
 26 input("\nPress enter to exit.")

7 comments

0

Shekelnose Goyfeld - "Good goy. Now thats one more thing we don't have to generate ourselves".

0
from random import choice
print("Jew name generator.\n")
first_names = ("Alan", "Bella", "Ben", "Bernie", "David", "Deborah", "Dianne", "Elaine", "Ellen",
               "Isaac", "Israel", "Jerry", "Joe", "Madeleine", "Moses", "Samuel", "Simon", "William")
last_starters = ("Ber", "Blumen", "Fein", "Gold", "Leh", "Mad", "Rosen", "Roth", "Weis")
last_enders = ("berg", "berger", "coff", "gold", "man", "man", "stein", "thal", "thal", "witz")
while True:
    first = choice(first_names)
    last = choice(last_starters) + choice(last_enders)
    print("\n" + first, last)
    if input("\n\nEnter 'n' to quit or press enter to try again.") == "n":
        break
0

Nice!

0

Improved Jew generator with more names and ten results at a time:

import random
print("Jew name generator.")
first_names = ("Alan", "Barbara", "Bella", "Ben", "Bernie", "Chaim", "David", "Deborah", "Dianne",
               "Elaine", "Ellen", "Irving", "Isaac", "Israel", "Jerry", "Joe", "Judy", "Leonard",
               "Madeleine", "Max", "Moses", "Moshe", "Rachel", "Ruth", "Samuel", "Saul", "Shlomo",
               "Simon", "Susan", "William")
last_starters = ("Adel", "Alt", "Ber", "Blumen", "Fein", "Finkel", "Fried", "Gold", "Gold", "Green",
               "Hoff", "Kauf", "Leh", "Mad", "Rosen", "Roth", "Silver", "Stein", "Weiz", "Zucker")
last_enders = ("berg", "baum", "berger", "blatt", "coff", "gold", "man", "man", "schmidt", "son",
               "stein", "thal", "witz")
while True:
    print()
    for i in range(10):
        first = random.choice(first_names)
        last = random.choice(last_starters) + random.choice(last_enders)
        print("", first, last)
    if input("\nEnter 'n' to quit or press enter to try again.") == "n":
        break
0

Here's a different take on this:

print("\n(((" + input("Type name of 'fellow white person' article author.") + ")))\n")

0

LOL!!! Even here in "programming" on voat!!!!

0

"Levi" is a fine name, that I am proud to carry. You don't have it yet.