w3resource

Python: Find the Requests module version, licence, copyright information, author, author email, document url, title and description

Python Requests: Exercise-1 with Solution

Write a Python code to find the Requests module – version, licence, copyright information, author, author email, document url, title and description.

Sample Solution:

Python Code:

import requests
print("Python Requests module - version:",requests.__version__)
print("Licence:",requests. __license__)
print("Copyright:",requests.__copyright__)
print("Author:",requests.__author__)
print("Author email:",requests.__author_email__)
print("Document url, title, description:")
print(requests.__url__)
print(requests.__title__)
print(requests.__description__)

Sample Output:

Python Requests module - version: 2.22.0
Licence: Apache 2.0
Copyright: Copyright 2019 Kenneth Reitz
Author: Kenneth Reitz
Author email: [email protected]
Document url, title, description:
http://python-requests.org
requests
Python HTTP for Humans.

Python Code Editor:

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Python Requests Exercise Home.
Next: Write a Python code to check the status code issued by a server in response to a client's request made to the server. Print all of the methods and attributes available to objects on successful request.

What is the difficulty level of this exercise?

Test your Python skills with w3resource's quiz



Python: Tips of the Day

Merging two dicts in Python 3.5+ with a single expression

Example:

# How to merge two dictionaries
# in Python 3.5+

x = {'p': 1, 'q': 3}
y = {'q': 5, 'r': 8}

z = {**x, **y}

z
{'r': 4, 'p': 1, 'q': 3}

z = dict(x, **y)
print(z)

Output:

{'p': 1, 'q': 5, 'r': 8}