def pressure_cls(max_pressure, min_pressure):
'''
血圧分類関数
引数 max_pressure:収縮期血圧(最高血圧)
min_pressure:拡張期血圧(最低血圧)
戻り値 :血圧分類名(str)
'''
if (max_pressure < 120) and (min_pressure < 80):
category = '正常血圧'
elif (max_pressure < 130) and (min_pressure < 80):
category = '正常高値血圧'
elif (max_pressure < 140) and (min_pressure < 90):
category = '高値血圧'
elif (max_pressure < 160) and (min_pressure < 100):
category = 'Ⅰ度高血圧'
elif (max_pressure < 180) and (min_pressure < 110):
category = 'Ⅱ度高血圧'
else: # (max_pressure >= 180) or (min_pressure >= 110)
category = 'Ⅲ度高血圧'
return category
# 確認用コード
print(pressure_cls(119, 79)) # 正常血圧
print(pressure_cls(120, 78)) # 正常高値血圧
print(pressure_cls(130, 80)) # 高値血圧
print(pressure_cls(145, 90)) # Ⅰ度高血圧
print(pressure_cls(160, 100)) # Ⅱ度高血圧
print(pressure_cls(140, 110)) # Ⅲ度高血圧
正常血圧
正常高値血圧
高値血圧
Ⅰ度高血圧
Ⅱ度高血圧
Ⅲ度高血圧