Skip to content
TheChatArchiveThe Chat Archive
gpt-4o-mini-2024-07-18· OpenAIAi2 WildChat-4.8M (AI2)

write a python script full of funny jokes.

  1. User

    write a python script full of funny jokes.

  2. Assistant

    Sure! Here's a simple Python script that prints out a collection of funny jokes. You can run this script in any Python environment.

    import random
    
    def tell_joke():
        jokes = [
            "Why did the scarecrow win an award? Because he was outstanding in his field!",
            "Why don't skeletons fight each other? They don't have the guts!",
            "Why did the math book look sad? Because it had too many problems.",
            "Why can't you give Elsa a balloon? Because she will let it go!",
            "Why don't oysters donate to charity? Because they are shellfish!",
            "What did one wall say to the other wall? I'll meet you at the corner!",
            "Why did the coffee file a police report? It got mugged!",
            "What do you call fake spaghetti? An impasta!",
            "How does a penguin build its house? Igloos it together!",
            "Why was the broom late? It swept in!"
        ]
        
        print("Here's a funny joke for you:")
        print(random.choice(jokes))
    
    if __name__ == "__main__":
        while True:
            tell_joke()
            again = input("\nDo you want to hear another joke? (yes/no): ")
            if again.lower() != "yes":
                print("Alright, have a great day!")
                break
    

    How to Use:

    1. Copy the script into a Python file (e.g. funny_jokes.py).
    2. Run the script using a Python interpreter (e.g., python funny_jokes.py).
    3. Enjoy the jokes, and choose whether you want to hear another one or end the program!

    Feel free to add more jokes to the list or modify the script as you like!