Generation

generate functionTue, 11 Jul 2023

Escribir un programa que pregunte el nombre el un producto, su precio y un número de unidades y muestre por pantalla una cadena con el nombre del producto seguido de su precio unitario con 6 dígitos enteros y 2 decimales, el número de unidades con tres dígitos y el coste total con 8 dígitos enteros y 2 decimales.

def print_purchase(product, unit_price, unit_number): print(f'The product is {product:>10}, and the unit price is {unit_price:>10.6f}, and the number unit is {unit_number:>3} and the total cost is {unit_price * unit_number:>10.8f}')

Want to kickstart your project?Use the new AI Studio to create your code