Last active
September 5, 2023 11:36
-
-
Save fmasanori/4745061 to your computer and use it in GitHub Desktop.
Chuck Norris Nerd Jokes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from urllib.request import Request, urlopen | |
import json | |
req = Request( | |
url='https://api.chucknorris.io/jokes/random', | |
headers={'User-Agent': 'Mozilla/5.0'} | |
) | |
resp = urlopen(req).read() | |
data = json.loads(resp.decode('utf-8')) | |
print (data['value']) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
muito bom! Python é além de tudo divertido.
Ainda não sei o que vou fazer no meu TCC, a única coisa que eu sei é que vai ser em Python!