1. Programacion Modular¶

1.1. Archivo Transactions.txt¶

1.2. Venta Salgados¶
def salva_transacao(precio, tarjeta_de_credito, descripcion):
file = open('transacoes.txt',"a")
file.write("%16s%07d%16s\n" %(tarjeta_de_credito,precio*100,descripcion))
file.close()
articulos = ["Sfiha","Cocina","Pastel","Pan de queso"]
precios = [1.50,2.20,1.80,1.20]
corriendo = True
while corriendo:
opción = 1
for elegir in alrticulos :
print(str(opcion) + "." + elegir)
opcao += 1
print(str(opcion) + ".Finalizar")
elegir = int(input("Escoja una opción: "))
if elegir == opcion:
#escolheu a ultima opcion Finalizar
corriendo = False
else:
credito = input("Número de tarjeta de crédito: ")
guardar_transacción(precios[elegir-1],tarjeta,articulos[elegir-1])

Problemas: el banco rechazó el archivo de transacción completo para el período ¡de mañana!
Todas las tarjetas no eran válidas
¡Los precios eran demasiado altos: donut vendido por R $ 50.791,42!
En los otros períodos no hubo problema. Que paso


¡El banco cambió el orden de los datos! [Precio / Tarjeta / Artículo]


You have attempted of activities on this page