Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
Tags
- Git
- 캐치카페
- 편스토랑
- github
- programmers
- Kaggle
- 우분투
- 자연어처리
- 코로나19
- Real or Not? NLP with Disaster Tweets
- AI 경진대회
- 백준
- 맥북
- 파이썬
- 금융문자분석경진대회
- gs25
- 편스토랑 우승상품
- Docker
- PYTHON
- dacon
- hackerrank
- leetcode
- 프로그래머스
- 데이콘
- ubuntu
- ChatGPT
- SW Expert Academy
- Baekjoon
- 더현대서울 맛집
- 프로그래머스 파이썬
Archives
- Today
- Total
솜씨좋은장씨
[BaekJoon] 6825번 : Body Mass Index (Python) 본문
728x90
반응형

코딩 1일 1문제! 오늘의 문제는 백준의 Body Mass Index 입니다.
6825번: Body Mass Index
The Body Mass Index (BMI) is one of the calculations used by doctors to assess an adult’s health. The doctor measures the patient’s height (in metres) and weight (in kilograms), then calculates the BMI using the formula BMI = weight/(height × height).
www.acmicpc.net
👨🏻💻 코드 ( Solution )
def get_bmi(weight, height):
return weight / (height * height)
def body_mass_index(weight, height):
check_result = ""
bmi = get_bmi(
weight=weight, height=height
)
if bmi < 18.5:
check_result = "Underweight"
elif 18.5 <= bmi < 25:
check_result = "Normal weight"
elif bmi >= 25:
check_result = "Overweight"
return check_result
if __name__ == "__main__":
weight = float(input())
height = float(input())
print(body_mass_index(weight=weight, height=height))
GitHub - SOMJANG/CODINGTEST_PRACTICE: 1일 1문제 since 2020.02.07
1일 1문제 since 2020.02.07. Contribute to SOMJANG/CODINGTEST_PRACTICE development by creating an account on GitHub.
github.com
'Programming > 코딩 1일 1문제' 카테고리의 다른 글
[BaekJoon] 5691번 : 평균 중앙값 문제 (Python) (0) | 2022.12.31 |
---|---|
[BaekJoon] 11557번 : Yangjojang of The Year (Python) (0) | 2022.12.30 |
[BaekJoon] 26711번 : A+B (Python) (2) | 2022.12.28 |
[BaekJoon] 26574번 : Copier (Python) (0) | 2022.12.27 |
[BaekJoon] 5357번 : Dedupe (Python) (0) | 2022.12.26 |