Професионална програма
Loading...
Katrin_Kolarska avatar Katrin_Kolarska 0 Точки

Programming Basics; Phyton - Fuel Tank - Part 2

Здравейте, 
решавам задачата Fuel Tank - Part 2 - последната от допълнителните за Conditional Statements. В джъдж ми дава 90/100, но не мога да си открия грешката. Ще може ли някой да ми подскаже или да ми даде неговото решение :)
Благодаря. 

fuel_type = str(input())
fuel_quantity = float(input())
discount_card = str(input())
price= float()

if discount_card == "Yes" and fuel_type == "Gas":
    if fuel_quantity > 25:
        price = 0.9*(0.85 * fuel_quantity)
    elif 20 < fuel_quantity <= 25:
        price = 0.92*(0.85 * fuel_quantity)
    else:
        price = 0.85 * fuel_quantity
if discount_card == "No" and fuel_type == "Gas":
    if fuel_quantity > 25:
        price = 0.9 * (0.93*fuel_quantity)
    elif 20 < fuel_quantity <= 25:
        price = 0.92 * (0.93*fuel_quantity)
    else:
        price = 0.93*fuel_quantity
if discount_card == "Yes" and fuel_type == "Diesel":
    if fuel_quantity > 25:
        price = 0.9*(2.21 * fuel_quantity)
    elif 20 < fuel_quantity <= 25:
        price = 0.92*(2.21 * fuel_quantity)
    else:
        price = 2.21 * fuel_quantity
if discount_card == "No" and fuel_type == "Diesel":
    if fuel_quantity > 25:
        price = 0.9 * (2.33 * fuel_quantity)
    elif 20 < fuel_quantity <= 25:
        price = 0.92 * (2.33 * fuel_quantity)
    else:
        price = 2.33 * fuel_quantity
if discount_card == "Yes" and fuel_type == "Gasoline":
    if fuel_quantity > 25:
        price = 0.9*(2.10 * fuel_quantity)
    elif 20 < fuel_quantity <= 25:
        price = 0.92 * (2.10 * fuel_quantity)
    else:
        price = 2.10 * fuel_quantity
if discount_card == "No" and fuel_type == "Gasoline":
    if fuel_quantity > 25:
        price = 0.9 * (2.22 * fuel_quantity)
    elif 20 < fuel_quantity <= 25:
        price = 0.92 * (2.22 * fuel_quantity)
    else:
        price = 2.22 * fuel_quantity

print(f'{price:.2f} lv.')
Тагове:
0
Programming Basics 12/07/2020 20:16:31
danieldegarmo avatar danieldegarmo 1 Точки

Your Wi-Fi switch is the core of your home organization. It ensures all your information gets shipped off the correct spots, and it supplies your gadgets with a consistent web association. However, Best Countertop Pizza Ovens in a huge home, those associations can get stalled when the sign bobs off dividers, floors, and different hindrances.

0