This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| milk = {'weight' : 7.8,'name': 'Milk', 'price': 2.99, 'taxable': False, 'upc': '0001'} | |
| apples = {'weight' : 3.1, 'name': 'Apples', 'price': 3.99, 'taxable': False, 'upc': '0002'} | |
| bread = {'weight' : 1.25, 'name': 'Bread', 'price': .99, 'taxable': False, 'upc': '0003'} | |
| beer = {'weight' : 4.9, 'name': 'Beer', 'price': 7.99, 'taxable': True, 'upc': '0004'} | |
| chips = {'weight' : 0.96, 'name': 'Chips', 'price': 1.50, 'taxable': False, 'upc': '0005'} | |
| wine = {'weight' : 3.18, 'name': 'Red Wine', 'price': 9.99, 'taxable': True, 'upc': '0006'} | |
| oreos = {'weight' : 1.08, 'name': 'Double Stuf Oreos', 'price': 2.50, 'taxable': False, 'upc': '0007'} | |
| sushi = {'weight' : 1.65, 'name': 'Veggie Sushi', 'price': 5.99, 'taxable': False, 'upc': '0008'} | |
| sprite = {'weight' : 2.82, 'name': 'Sprite', 'price': 3.99, 'taxable': True, 'upc': '0009'} | |
| candy = {'weight' : 0.43, 'name': 'Sour Patch Kids', 'price': 1.99, 'taxable': True, 'upc': '0010'} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def calculate_tax(items): | |
| tax_total = 0 | |
| for item in items: | |
| print(item) | |
| tax = item * .07 | |
| print(round(tax, 2)) | |
| tax_total += tax |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| favorite_books = ["Midwives", "The Grapes of Wrath", "The Art of Racing in the Rain", "My Sister's Keeper", "Orphan Number Eight"] | |
| family_tree = [{"father" : "Dave", "mother" : "Brenda", "children" : {"child_1" : "Pamela", "child_2" : "Greg", "child_3" : "Laura"}}, | |
| {"father" : "Henry", "mother" : "Gretta", "children" : {"child_1" : "Stephen", "child_2" : "David", "child_3" : "Mary Ann"}}] | |
| # Zero tabs in Python. Indent the equivalent of FOUR spaces. | |
| for book in favorite_books: | |
| print("I love " + book + "!") |