Skip to content

Fa1343/forth-resp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 

Repository files navigation

random_joke_advanced.py

import random

jokes = [ "Why don't skeletons fight each other? Because they don't have the guts! πŸ’€πŸ˜‚", "I told my computer I needed a break, and now it won’t stop sending me Kit-Kats. 🍫", "Why did the math book look sad? Because it had too many problems. βž—πŸ˜­", "I asked the librarian if the library had books on paranoia... she whispered, 'They're right behind you.' πŸ‘€", "Why can't your nose be 12 inches long? Because then it would be a foot! πŸ‘ƒπŸ˜‚", "What do you call fake spaghetti? An impasta! 🍝", "Why did the scarecrow win an award? Because he was outstanding in his field! πŸŒΎπŸ†" ]

print("πŸ˜‚ Random Joke Generator πŸ˜‚")

while True: try: count = int(input("How many jokes do you want? (1-5) ")) if 1 <= count <= 5: selected = random.sample(jokes, count) print("\nHere are your jokes:\n") for joke in selected: print(f"- {joke}") print("\n--- End ---\n") else: print("Please enter a number between 1 and 5.") except ValueError: print("Please enter a valid number.")

again = input("Do you want more jokes? (y/n) ").lower()
if again != 'y':
    print("Thanks for playing! πŸ˜„")
    break# forth-resp

joke

About

joke

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published