mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 01:09:40 +08:00
refactor: Move constants outside of variable scope (#7262)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com> Co-authored-by: Christian Clauss <cclauss@me.com>
This commit is contained in:
@ -10,15 +10,15 @@ import pprint
|
||||
|
||||
import requests
|
||||
|
||||
API_ENDPOINT_URL = "https://zenquotes.io/api"
|
||||
|
||||
|
||||
def quote_of_the_day() -> list:
|
||||
API_ENDPOINT_URL = "https://zenquotes.io/api/today/" # noqa: N806
|
||||
return requests.get(API_ENDPOINT_URL).json()
|
||||
return requests.get(API_ENDPOINT_URL + "/today").json()
|
||||
|
||||
|
||||
def random_quotes() -> list:
|
||||
API_ENDPOINT_URL = "https://zenquotes.io/api/random/" # noqa: N806
|
||||
return requests.get(API_ENDPOINT_URL).json()
|
||||
return requests.get(API_ENDPOINT_URL + "/random").json()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
Reference in New Issue
Block a user