Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

calculating the shipping order #12

Open
@mcbrighty

Description

I decided to add Boolean variable to this code of solving it and whenever I ran my code I get additional 1ドル added if the total shipping order exceeds or equals 50ドル. Why?
This is the code:

Program to calculate a shipping order and give a tip of free shipping if order exceeds 50ドル else 10ドル fee

shippingFee = False
sumTotal = 0

orderTotal = float(input("Enter the total amount of order "))
if orderTotal >= 50:
shippingFee = True
print("Shipping is free")

else:
shippingFee = 10
print("Shipping fee will cost additional 10ドル")

sumTotal = orderTotal + shippingFee

print("Your total shipping fee with order is $%2f" % sumTotal)
print("Your total shipping fee with order is $" + str(sumTotal))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /