I'm a newbie when it comes to Python, so please forgive me for this stupid question however, here it is :D The following code is just for practice for my Python course. The source code can be found here: https://pastebin.com/46CfQzhu
The output would vary based on the number of people and the type of activity. Every single test works, except when I assign 20 for junior, 20 for senior and the activity to be cross-country. According to the problem's description, when those number are used, the end result should be 377.63. However I get 377.62. I need to format the number to .2f, however that doesn't give me the right value at the end. Tried round() and it was still a no go. The number is actually 377.625 and it should round up to 377.63.. Any thoughts on the matter? Thanks!
PS I'm copying the code here, for better visibility.
tax = round(tax,2)
print(f'{tax:.2f}')
junior = int(input())
senior = int(input())
trace = input()
tax=0
if trace == 'trail':
tax = junior * 5.50 + senior * 7
elif trace =='cross-country':
if (junior + senior) >= 50:
tax = (junior * 8 + senior * 9.50) * 0.75
else:
tax = junior * 8 + senior * 9.50
elif trace =='downhill':
tax = junior *12.25 + senior * 13.75
elif trace =='road':
tax = junior * 20 + senior*21.50
tax = tax*0.95
tax = round(tax,2)
print(f'{tax:.2f}')