THM Python
https://tryhackme.com/room/pythonbasics
# Code to calcute shipping + cost and if shipping is free (THM code)
shipping_cost_per_kg = 1.20
customer_basket_cost = 34
customer_basket_weight = 44
if(customer_basket_cost >= 100):
print('Free shipping!')
else:
shipping_cost = customer_basket_weight * shipping_cost_per_kg
customer_basket_cost = shipping_cost + customer_basket_cost
print("Total basket cost including shipping is " + str(customer_basket_cost))# Code to calcute shipping + cost and if shipping is free (My code)
shipping_cost_per_kg = 1.20
customer_basket_cost = 34
customer_basket_weight = 44
if customer_basket_cost >=100:
print("FREE SHIPPING")
else:
shipping_cost = customer_basket_weight * shipping_cost_per_kg
grand_total = shipping_cost + customer_basket_cost
print("Your grand total, inclduing shipping is: £" + str(grand_total))PreviousPython - 100 Days of Code: The Complete Python Pro Bootcamp - NotesNextDay 1 - Band Name Generator Project
Last updated