''' Purpose: dataset nuance introduction ''' best_sellers = [ [ "Name", "Author", "Language", "Date", "Sales" ], [ "Don Quixote", "de Cervantes", "Spanish", 1605, 500000000 ], [ "A Tale of Two Cities", "Dickens", "English", 1859, 200000000 ], [ "The Lord of the Rings", "Tolkien", "English", 1954, 150000000 ], [ "The Little Prince", "de Saint-Exupery", "French", 1943, 140000000 ], [ "Harry Potter", "Rowling", "English", 1997, 120000000 ], [ "The Hobbit", "Tolkien", "English", 1937, 100000000 ], [ "And Then There Were None", "Christie", "English", 1939, 100000000 ], [ "Dream of the Red Chamber", "Xueqin", "Chinese", 1754, 100000000 ], [ "Alice's Adventures in Wonderland", "Carroll", "English", 1865, 100000000 ], ] # print the dataset for row in best_sellers : print( row ) print() # separate out dataset elements header = best_sellers[ 0 ] books = best_sellers[ 1 : ] # determine Sales column sales_column = header.index( 'Sales' ) print( 'sales column:', sales_column ) print() # determine total book solds amongs the top best sellers of all time total = 0 for book in books : sold = book[ sales_column ] total = total + sold billions_of_books = total / 1000000000 print( 'Total sold:', billions_of_books, 'billion' )