1👍
✅
In Python 3, /
uses floating-point arithmetic when necessary. In Python 2, you have to specify float
s. Change:
(w/h) * 400
to
(float(w)/h) * 400
and similar, wherever necessary.
Source:stackexchange.com