Untitled
unknown
plain_text
3 years ago
532 B
4
Indexable
import random
def generate_joke():
joke_templates = [
"Why do they call it {0} when nothing {1}?",
"Why do we {0} in {1} and {2} on {3}s?",
"Why do they {0} {1} on {2} {3} machines?"
]
jokes = [
["rush hour", "moves"],
["park", "driveways", "drive", "parkway"],
["put", "braille", "drive-thru", "ATM"]
]
chosen_joke = random.choice(jokes)
chosen_template = random.choice(joke_templates)
return chosen_template.format(*chosen_joke)
print(generate_joke())
Editor is loading...