Listing 11 - Page 0: No Title

##############################################################################
# Python From Scratch
# Autor: Nilo Ney Coutinho Menezes
# Editora Novatec (c) 2010-2024
# Site: https://pythonfromscratch.com
#
# File: listing\chapter 11\11.1491 - No Title.py
# Description: No Title
##############################################################################

import sqlite3
print("Region Number of States")
print("====== ================")
with sqlite3.connect("brazil.db") as connection:
    for region in connection.execute("""
        select region, count(*)
        from states
        group by region"""):
        print("{0:6} {1:17}".format(*region))
Click here to download the file