Last active
September 9, 2019 04:35
-
-
Save h2ospace/20e6469679555e06ba3bc52fc5d15ada to your computer and use it in GitHub Desktop.
BMI計算ツール(Python)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 身長 | |
height = input('身長(cm) >> ') | |
# 体重 | |
weight = input('体重(kg) >> ') | |
height = float(height) | |
weight = float(weight) | |
# BMIを計算 | |
bmi = weight / ((height/100) ** 2) | |
# 四捨五入 | |
bmi = round(bmi, 1) | |
print("BMI: " + str(bmi)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment