This commit is contained in:
adii1823
2021-10-28 17:37:54 +05:30
parent 8b802c5c62
commit ee641c189f
49 changed files with 601 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# docstrings.py
def square(n):
"""Return the square of a number n. """
return n ** 2
def get_username(userid):
"""Return the username of a user given their id. """
return db.get(user_id=userid).username
def connect(host, port, user, password):
"""Connect to a database.
Connect to a PostgreSQL database directly, using the given
parameters.
:param host: The host IP.
:param port: The desired port.
:param user: The connection username.
:param password: The connection password.
:return: The connection object.
"""
# body of the function here...
return connection