Body Age Calculator
根据BMI、血压、运动习惯和生活方式因素估计您的生物学年龄。
低高
关于此工具
身体年龄计算器根据BMI、血压、运动水平和生活习惯等健康指标来估算您的生物年龄。与您的实际年龄不同,生物年龄反映的是您的身体在细胞水平上的功能状况和恢复能力。该工具特别适合那些想跟踪健康轨迹、了解生活方式改变的影响,或在不就医的情况下获得基本健康评估的人。
使用计算器时,只需输入您的基本信息——年龄、性别、体重、身高、血压读数、运动频率以及吸烟和饮酒等生活习惯。该工具随后会根据健康指南和研究数据分析这些输入,估算您的身体是比实际年龄年轻、衰老还是大致相同。大多数人每年进行一次这样的评估,以监测变化并激励自己养成更健康的习惯。
请记住,该计算器提供的只是教育性估算,不是医学诊断。遗传因素、睡眠质量、压力水平和特定的医学状况等因素可能会对真实的生物年龄产生重大影响,但这些因素可能无法在此处完全反映。如果您有现有的健康问题或正在服用药物,请考虑与医疗专业人士讨论您的结果,以获得更全面的健康评估。
常见问题
代码实现
def calculate_body_age(
chronological_age: int,
bmi: float,
systolic_bp: int,
resting_hr: int,
weekly_exercise_hours: float,
smoking: bool,
sleep_hours: float,
stress_level: int # 1-10
) -> dict:
"""
Estimate biological age based on lifestyle factors.
Returns body age and adjustments.
"""
body_age = chronological_age
adjustments = []
# BMI impact (optimal 18.5-24.9)
if bmi < 18.5:
body_age += 1
adjustments.append("Underweight (+1 year)")
elif 25 <= bmi < 30:
body_age += 2
adjustments.append("Overweight (+2 years)")
elif bmi >= 30:
body_age += 5
adjustments.append("Obese (+5 years)")
# Blood pressure (optimal < 120/80)
if systolic_bp >= 140:
body_age += 5
adjustments.append("High blood pressure (+5 years)")
elif systolic_bp >= 120:
body_age += 2
adjustments.append("Elevated BP (+2 years)")
# Resting heart rate (optimal 50-70)
if resting_hr < 60:
body_age -= 2
adjustments.append("Low resting HR (-2 years)")
elif resting_hr > 90:
body_age += 4
adjustments.append("High resting HR (+4 years)")
elif resting_hr > 75:
body_age += 2
adjustments.append("Slightly high HR (+2 years)")
# Exercise (optimal 5+ hours/week)
if weekly_exercise_hours >= 5:
body_age -= 4
adjustments.append("Active lifestyle (-4 years)")
elif weekly_exercise_hours >= 2.5:
body_age -= 2
adjustments.append("Moderate exercise (-2 years)")
elif weekly_exercise_hours < 1:
body_age += 3
adjustments.append("Sedentary (+3 years)")
# Smoking
if smoking:
body_age += 8
adjustments.append("Smoking (+8 years)")
# Sleep (optimal 7-9 hours)
if sleep_hours < 6 or sleep_hours > 9:
body_age += 2
adjustments.append("Poor sleep (+2 years)")
# Stress (optimal 1-3)
if stress_level >= 7:
body_age += 3
adjustments.append("High stress (+3 years)")
elif stress_level >= 5:
body_age += 1
adjustments.append("Moderate stress (+1 year)")
return {
"chronological_age": chronological_age,
"body_age": max(chronological_age - 15, body_age),
"difference": body_age - chronological_age,
"adjustments": adjustments
}
result = calculate_body_age(
chronological_age=35, bmi=22.5, systolic_bp=115,
resting_hr=62, weekly_exercise_hours=4, smoking=False,
sleep_hours=7.5, stress_level=4
)
print(f"Chronological age: {result['chronological_age']}")
print(f"Body age: {result['body_age']}")
print(f"Difference: {result['difference']:+d} years")Comments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.