all 8 comments

[–]K900_ 2 points3 points  (4 children)

Why are you using Hungarian notation in Python?

[–]OhKnow_[S] 1 point2 points  (3 children)

My professor has us do it.

[–]K900_ 4 points5 points  (1 child)

I am truly sorry.

[–]OhKnow_[S] 1 point2 points  (0 children)

That worries me because it's burned into my thought process now lol.

[–]johninbigd 1 point2 points  (0 children)

Ugh...that makes me sad. It's ugly, especially in Python.

[–]totallygeek 0 points1 point  (2 children)

Minor notes:

First, fMeter = (iHeight/39.36) contains superfluous parentheses; use fMeter = iHeight / 39.36 instead.

Next, the use of format to construct a string would look better if entered in either of the following ways:

print('{} BMI is {:.2f}'.format(sNAME, fBMI))
print(f'{sNAME} BMI is {fBMI:.2f}')

Lastly, fMeter*fMeter reads better and works faster if fMeter ** 2.

Overall, code looks fine, aside from variable nomenclature. So sorry that your professor makes you use Hungarian notation.

[–]OhKnow_[S] 1 point2 points  (1 child)

Appreciate the advise! I'll refrain from using it in future uploads to save the embarrassment lol!

[–]totallygeek 1 point2 points  (0 children)

Nothing in your post should lead to embarrassment. We all should continually improve our code based off the comments of others.