cristibodnariuc commited on
Commit
3059460
·
verified ·
1 Parent(s): 75b9b3b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -53,11 +53,11 @@ def get_random_joke(type: str) -> str:
53
 
54
  if not type or type in types:
55
  if isinstance(joke, list) and len(joke) > 0:
56
- return f"- {joke[0]["setup"]}\n- {joke[0]["punchline"]}"
57
  else:
58
- return f"- {joke["setup"]}\n- {joke["punchline"]}"
59
 
60
- return f"Type not found. Getting a random joke. (available types: {types})\n- {joke["setup"]}\n- {joke["punchline"]}"
61
 
62
  except requests.exceptions.Timeout:
63
  return "The request timed out. Please try again later or check the URL."
 
53
 
54
  if not type or type in types:
55
  if isinstance(joke, list) and len(joke) > 0:
56
+ return f"- {joke[0]['setup']}\n- {joke[0]['punchline']}"
57
  else:
58
+ return f"- {joke['setup']}\n- {joke['punchline']}"
59
 
60
+ return f"Type not found. Getting a random joke. (available types: {types})\n- {joke['setup']}\n- {joke['punchline']}"
61
 
62
  except requests.exceptions.Timeout:
63
  return "The request timed out. Please try again later or check the URL."