Your code is not valid: You can't break up an
if...elif...
with a
print('finished')
at the same indentation level as
if
/
elif
. And your question is still not clear: In the added text you say you did something wrong - what makes you think you did something wrong? You ask if it is better to use
float
: That depends on what you want to achieve. If you want to calculate with non-integer numbers then you need
float
, otherwise you don't. ... If you want a
code review then SO is the wrong place,
here is the right one. —
Timus 1 min ago