The code and output which I have written is attached below.. FInd it in above images.
import psycopg2
conn = psycopg2.connect("dbname='news' user='postgres'")
cursor = conn.cursor()
cursor.execute(
"SELECT * FROM authors")
results = cursor.fetchall()
print (results)
conn.close
The code and output:
The output format what I want: