편집 기록

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

    IndentationError 질문


    몬티홀 문제를 파이썬으로 해결하기 위해 다음과 같은 코드를 작성했습니다.

    for _ in range(trial):
        선물 = random.randint(0, 2)
        player_choice = random.randint(0, 2)
    
        꽝 = []
    
        for i in range(3):
            if i!= player_choice and i != 선물:
                꽝.append(door[i])
    

    여기서

    if i!= player_choice and i != 선물:
    

    이 라인이 IndentationError: unindent does not match any outer indentation level 라고 뜹니다. 잘 쓴 것 같은데 왜 그럴까요?

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

    IndentationError 질문


    몬티홀 문제를 파이썬으로 해결하기 위해 다음과 같은 코드를 작성했습니다.

    //for _ in range(trial):
        선물 = random.randint(0, 2)
        player_choice = random.randint(0, 2)
    
        꽝 = []
    
        for i in range(3):
            if i!= player_choice and i != 선물:
                꽝.append(door[i])
    

    여기서

    //if i!= player_choice and i != 선물:
    

    이 라인이 IndentationError: unindent does not match any outer indentation level 라고 뜹니다. 잘 쓴 것 같은데 왜 그럴까요?