error_handler.py 1.8 KB

123456789101112
  1. import random
  2. jokes = ["What did one traffic light say to the other? Stop looking at me, I'm changing!", "What do you call bears with no ears? B.", "What's a foot long and slippery? A slipper!", "Why do French people eat snails? They don't like fast food!", "What's red and moves up and down? A tomato in an elevator!", "I invented a new word today: Plagiarism.", "What is sticky and brown? A stick!", "Why don't scientists trust atoms? Because they make up everything!", "Talk is cheap? Have you ever talked to a lawyer?", "Why did the gym close down? It just didn't work out!", "Two artists had an art contest. It ended in a draw!", "You can only get spoiled milk from a pampered cow.", "What do you call a boomerang that doesn't come back? A stick!", "You know what I saw today? Everything I looked at.", "What are a shark's two most favorite words? Man overboard!", "If we shouldn't eat at night, why do they put a light in the fridge.", "Why are ghosts such bad liars? Because they are easy to see through.", "Here, I bought you a calendar. Your days are numbered now.", "Where do fish sleep? In the riverbed.", "What did one plate say to his friend? Tonight, dinner's on me!", "I tried to sure the airport for misplacing my luggage. I lost my case.", "Why doesn't the sun go to college? Because it has a million degrees!", "I have many jokes about rich kids - sadly none of them work.", "Why was six afraid of seven? Because seven ate nine.", "How do trees get online? They just log on!", "My girlfriend treats me like a god. She ignores my existence and only talks to me when she needs something.", "What did 0 say to 8? Nice belt!"]
  3. try:
  4. ccfg
  5. xgbc
  6. txsr
  7. except Exception:
  8. joke_random = random.choice(jokes)
  9. print(f'Произошла ошибка, пришло время случайной шутки:\n {joke_random}')