Repozitář pro studenty 3.ročníku zaměření IVE
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

17 lines
435 B

# python -m venv .venv
# .venv\Scripts\activate
# pip install requests matplotlib
# pip list
import requests
url = "https://api.chucknorris.io/jokes/random"
while(input("Nex joke? q = quit:") != "q"):
response = requests.get(url)
if response.status_code == 200:
data = response.json()
print(f"Joke: {data["value"]}")
print(data["created_at"])
else:
print(f"Chyba: {response.status_code}")