Besides the syntax errors, the calculation seems wrong. Do you even need
To stop us guessing, it might actually help if you posted the text of your assignment verbatim.
if
, elif
and else
in the first place? Again, how would you do the calculation on paper? Are you sure the expected values on lines 23 and 26 are correct (particularly 26)?To stop us guessing, it might actually help if you posted the text of your assignment verbatim.