SyntaxFix
Write A Post
Hire A Developer
Questions
This is because (100/500) is an integer expression yielding 0.
(100/500)
Try
per = 100.0 * tota / 500
there's no need for the float() call, since using a floating-point literal (100.0) will make the entire expression floating-point anyway.
float()
100.0