편집 기록

편집 기록
  • 프로필 엽토군님의 편집
    날짜2019.01.23

    [파이썬] if 사용할때 들여쓰기질문 (코딩처음해봄)


    BMI지수로 과체중 저체중 적정체중인지 판단하려하는데

    if BMI<18.5:
        print("Your BMI indicates that you are underweight.")
        if BMI>25:
            print("Your BMI indicates that you are overweight.")
    else:
        print("Your BMI indicates that you are optimal weight.")
    

    이렇게 써보니까 BMI가 25가 넘어갈때도 optimal weight라고 뜨더라고요
    어떻게 고쳐야 제가 원하는대로 나올수있을까요?

  • 프로필 알 수 없는 사용자님의 편집
    날짜2019.01.23

    [파이썬] if 사용할때 들여쓰기질문 (코딩처음해봄)


    BMI지수로 과체중 저체중 적정체중인지 판단하려하는데

    if BMI25: print("Your BMI indicates that you are overweight.") else: print("Your BMI indicates that you are optimal weight.")

    이렇게 써보니까 BMI가 25가 넘어갈때도 optimal weight라고 뜨더라고요 어떻게 고쳐야 제가 원하는대로 나올수있을까요?