You are on page 1of 2

Tutorial_Function_1211304339

December 29, 2022

[28]: def cost_of_trip(flight, hotel, car):


cost_of_trip = flight + hotel + car
return cost_of_trip

[29]: cost_of_trip(200, 20*7, 200) #Paris

[29]: 540

[30]: cost_of_trip(250, 30*7, 120) #London

[30]: 580

[31]: cost_of_trip(370, 15*7, 80) #Dubai

[31]: 555

[32]: cost_of_trip(450, 10*7, 70) #Mumbai

[32]: 590

[33]: # 1. A vacation to Paris is the cheapest

[34]: # for 4 days

[35]: cost_of_trip(200, 20*4, 200) #Paris

[35]: 480

[36]: cost_of_trip(250, 30*4, 120) #London

[36]: 490

[37]: cost_of_trip(370, 15*4, 80) #Dubai

[37]: 510

[38]: cost_of_trip(450, 10*4, 70) #Mumbai

1
[38]: 560

[39]: # 2a. Cheapest is still Paris if vacation is 4 days

[40]: # for 2 weeks

[41]: cost_of_trip(200, 20*14, 400) #Paris

[41]: 880

[42]: cost_of_trip(250, 30*14, 240) #London

[42]: 910

[43]: cost_of_trip(370, 15*14, 160) #Dubai

[43]: 740

[44]: cost_of_trip(450, 10*14, 140) #Mumbai

[44]: 730

[45]: # 2b. Cheapest is Mumbai if vacation is 2 weeks

[46]: # 3. For $1000, Mumbai is best for maximise duration and London is best for␣
,→minimise duration.

[ ]: # 4. Answer does not change for $1500 and $2000. For $600, Paris is best for␣
,→maximise duration and Mumbai is best for minimise

You might also like