Python3 to calculate BMI, come with me and calculate your BMI.

Source: Internet
Author: User

nonsense not much to say, directly on the program ha:
Name=Input' Name: ')
height=Input' Height (m): ')
weight=Input' Weight (kg): ')
Bmi=FloatFloat (weight)/(Float (height) * *2))
Print‘You aBmiThe index is:', BIM)
If BMI <18.5:
     Print‘You are too light!‘)
Elif bmi<=25:
     print ( ' standard weight Oh Oh! elif bmi<=32:
print ( ' You are a little chubby oh Oh! else:
print ( ' You're too fat to lose weight.
Nonsense not much to say that the improved version continues on the program ha:
Def BMI ():
   Name=Input' Name: ')
height=Input' Height (m): ')
weight=Input' Weight (kg): ')
bim=FloatFloat (weight)/(Float (height) * *2))
   Print‘You aBIMThe index is:', BIM)
   If BIM <18.5:
   Print‘You are too light!‘)
   Elif bim<=25:
Print‘Standard Weight Oh Oh!‘)
   Elif bim<=32:
   Print‘You are a little chubby oh Oh!‘)
   Else
   Print‘You're too fat to lose weight. BMI ()
for I in range ( 10):
Choose =input ( ' Would you like to continue to calculate bmi (y/n) :")
if choose== Y":
BMI ()
else:
break
  &NBSP;   
< Span style= "color: #008080; Font-weight:bold ">&NBSP;   

Python3 to calculate BMI, come with me and calculate your BMI.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.