Python 血液型判定プログラム - 父親と母親の血液型から子供の血液型を判定
st123456 作成者名
父親と母親の血液型を入力
father_blood_type = input("父親の血液型を入力してください(AまたはB):") mother_blood_type = input("母親の血液型を入力してください(AまたはB):")
子供の血液型を判定
if father_blood_type == "A" and mother_blood_type == "A": child_blood_type = "AまたはO" elif father_blood_type == "A" and mother_blood_type == "B": child_blood_type = "AまたはB" elif father_blood_type == "B" and mother_blood_type == "A": child_blood_type = "AまたはB" elif father_blood_type == "B" and mother_blood_type == "B": child_blood_type = "BまたはO" else: child_blood_type = "不明"
子供の血液型を表示
print("あなたの血液型は「" + child_blood_type + "」です.")
原文地址: https://www.cveoy.top/t/topic/qFFG 著作权归作者所有。请勿转载和采集!