Loading...
Loading...
A courier charges by weight: 50 up to 1 kg, 100 up to 5 kg and 200 above 5 kg. The zone adds a fee: local adds 0, national adds 60 and international adds 150. A member (yes) gets 20% off the total, calculated as total * 80 // 100. A non-member (no) pays the full total.
Given the weight in kg, the zone and the member answer, print the charge. For an unknown zone print Invalid zone.
yes or no).Invalid zone.Example 1
Input
3 national no
Output
160
Example 2
Input
8 local yes
Output
160
Try the problem first. Open one hint at a time.
Find the base charge with an elif ladder on the weight, then use match-case on the zone to find the zone fee.
Take the discount last, on the total. Do not discount the base and zone fee separately.
Write your Python code, run it on the examples and submit it to hidden tests.
Solve in the editor