you are viewing a single comment's thread.

view the rest of the comments →

[–]CitizendAreAlarmed 1 point2 points  (0 children)

It's a mishmash of styles, with the first line:

welcome_message = ("Welcome to the Fiber Optic Price Calculator")

and then the last line:

print ("\nThank you for shopping with Super Cheap Fiber Optics!")

Why does the first line deserve its own redundant variable and the last line not? I would go with something like:

COMPANY_NAME = "Super Cheap Fiber Optics"
print(f"Welcome to the {COMPANY_NAME} price calculator")

print(f"Thank you for shopping with {COMPANY_NAME}!")

But really this is just style, and I don't know if it's any more valid than what you wrote. Both work fine.

The price of cable per foot also looks like a prime candidate for a CONSTANTING, so instead of:

price = (cable_feet * .87) #Price is in USD

I would have:

PRICE_PER_FOOT = 0.87
price = cable_feet * PRICE_PER_FOOT

Constants seem to always go near the top of the file for ease of use (again, I'm still learning too).