Skip to Main Content
USE A CABEÇA! PROGRAMAÇÃO
book

USE A CABEÇA! PROGRAMAÇÃO

by David Griffiths, Paul Barry
January 2009
Beginner to intermediate content levelBeginner to intermediate
440 pages
13h 6m
Portuguese (Portugal, Brazil)
Alta Books
Content preview from USE A CABEÇA! PROGRAMAÇÃO
202 Capítulo 6
from transactions import *
items = ["DONUT", "LATTE", "FILTER", "MUFFIN"]
prices = [1.50, 2.20, 1.80, 1.20]
running = True
while running:
option = 1
for choice in items:
print(str(option) + ". " + choice)
option = option + 1
print(str(option) + ". Quit")
choice = int(input("Choose an option: "))
if choice == option:
running = False
else:
credit_card = input("Credit card number: ")
save_transaction(prices[choice - 1], credit_card, items[choice - 1])
def discount(price):
Complete o código na função acima para que retorne 90% do preço dado.
Esta é a versão mais recente do módulo coffee_pdv.py. Modique-a para que use o novo
módulo para cortar ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

USE A CABEÇA! ÁLGEBRA

USE A CABEÇA! ÁLGEBRA

Tracey Pilon, Dan Pilon
Use A Cabeça Ágil

Use A Cabeça Ágil

Jennifer Stellman, Andrew Greene
Use A Cabeça Padrões E Projetos

Use A Cabeça Padrões E Projetos

Eric Freeman, Elisabeth Freeman, Kathy Sierra, Bert Bates

Publisher Resources

ISBN: 9788576084730