Finished the code it should work now

This commit is contained in:
tsmith372
2026-02-17 13:34:46 -05:00
parent f56535ded9
commit 7861fd339c
2 changed files with 2 additions and 1 deletions

2
api.py
View File

@@ -49,7 +49,7 @@ class RiddleAPI:
riddles = self.get_all_riddles()
if len(riddles) == 0:
raise APIError(["Sorry, there are no riddles on the server!"])
return random.choice(riddles)
return choice(riddles)
def add_riddle(self, question, answer):

View File

@@ -4,6 +4,7 @@
# RiddleView provides a nice user interface for guessing riddles.
from api import RiddleAPI
import requests
class RiddleView:
"Allows a player to interact with a Riddle Server from the Terminal"