Skip to content

Instantly share code, notes, and snippets.

@dolohow
Created January 6, 2020 16:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dolohow/caf56d9e4dcd7266cf68adfbc6342caf to your computer and use it in GitHub Desktop.
Save dolohow/caf56d9e4dcd7266cf68adfbc6342caf to your computer and use it in GitHub Desktop.
Price of importing car in USA
from pylab import *
car_price_from_auction = list(range(0, 10001, 500))
dollar_cost = 3.97
euro_cost = 4.39
euro_to_dollar = 1.11
pln_to_usd = 0.25
def total_cost(car_price_from_auction):
# all prices are dollar here
copart_provision = 540 # 540-790
road_transport = 530 # 180-1100
sea_freight = 690
forwarding_fee = 150
custom = (car_price_from_auction + road_transport + copart_provision + forwarding_fee + sea_freight) * 0.1
#custom = (car_price_from_auction + road_transport + copart_provision + forwarding_fee) * 0.1
vat = (car_price_from_auction + sea_freight + copart_provision + road_transport + forwarding_fee + custom) * 0.21
#vat = (car_price_from_auction + copart_provision + road_transport + forwarding_fee) * 0.21
forwarding_fee_europe = 450 * 1.11
road_transport_europe = 1252 * 1.45 * pln_to_usd
#excise = car_price_from_auction * 0.031
excise = (car_price_from_auction + copart_provision + road_transport + forwarding_fee) * 0.031
commission = 0.05 * car_price_from_auction
if commission < 850:
commission = 850
return (car_price_from_auction + copart_provision + road_transport +
sea_freight + forwarding_fee + custom + vat + forwarding_fee_europe +
road_transport_europe + excise + commission)
total_price = [total_cost(i)*dollar_cost for i in car_price_from_auction]
plot(car_price_from_auction, total_price)
title("Cena sprowadzenia auta z USA")
xlabel("Cena auta [$]")
ylabel("Cena ostateczna [zł]")
grid(True)
show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment