Question
how to run all this code in python , please show with output picture 1- import requests response = requests.get('https://api.github.com') print (response.status_code ) 2- import
how to run all this code in python , please show with output picture
1- import requests response = requests.get('https://api.github.com')
print (response.status_code )
2- import requests response = requests.get('https://api.github.com')
if response.status_code == 200: print('Success!')
elif response.status_code == 404: print('Not Found.')
3- import requests response = requests.get('https://api.github.com')
print (response.content)
4- import requests response = requests.get('https://api.github.com')
print (response.text)
5- import requests response = requests.get('https://api.github.com')
print (response.json())
6- import requests response = requests.get('https://api.github.com')
print (response.headers)
7- import requests response = requests.get( 'https://api.github.com/search/repositories', params={'q': 'requests+language:python'}, )
# Inspect some attributes of the `requests` repository json_response = response.json() repository = json_response['items'][0]
print(f'Repository name: {repository["name"]})
print(f'Repository description: {repository["description"]}')
8- import requests r = requests.get('https://identity.ksu.edu.sa/sites/identity.ksu.edu.sa/files/imce _images/ksu_masterlogo_colour_rgb.png')
print(r.content)
f = open('logo.png', 'wb')
f.write(r.content)
f.close()
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started