/
rnekrasov
/
Python
Обзор
Документация
Войти
/
rnekrasov
/
Python
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
quote.py
22 строки
460 B
slowy07
refactor: clean code
30 янв 2022, 04:33
30 янв 2022, 04:33
f0af0c4
Код
Авторство
О чём код?
# Sends inspirational quotes to the user using Zen Quotes API # Format """ example quote -Quote Author Name """ import requests from json import loads def return_quote(): response = requests.get("https://zenquotes.io/api/random") json_data = loads(response.text) quote = ( json_data[0]["q"] + " -" + json_data[0]["a"] ) # aligning the quote and it's author name in one string return quote quote = return_quote() print(quote)