---
# System prepended metadata

title: Homework 1 - BMI Calculator

---

# Homework 1 - BMI Calculator 
### Author: Tyler Eck - 410821337 

## Instructions

:::info 
請使用者輸入所需資訊計算出其BMI
體重單位為公斤 身高單位為公尺
BMI計算至小數點後兩位

程式請在 Colab 中完成再將程式和結果 copy 至 HackMD
請上傳 Colab 和 HackMD 的分享連結，並分享權限，否則無法批閱
Hint:
weight = int(input("......"))  # 加上 int 這樣 weight 才能變成數字才能作計算

::: 

## Code
``` python =
#Tyler Eck
#410821337 
#9.28.2022 
#BMI Calculator - A calculator used to calculate BMI

#First get the inputs of weight and height in float 
#(because kg and height will probably have decimal points)
print("BMI Calculator")
weight = float(input("Enter Weight in kg: "))
height = float(input("Enter Height in m: "))

#Calculation for bmi and output to 2 decimal places
bmi = (weight/(height*height))
print("Your bmi is ",round(bmi,2))
```
## Example Output 
![](https://i.imgur.com/U4KRZX3.png)

