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