Re: 24.5 심사문제수요일, 18 8월 2021, 9:47 오전, 도장_ 관리자님이 작성 포럼 상단 오른쪽 검색창에 24.5로 검색하면 많은 이전 질문과 답변을 참조할 수 있습니다.https://dojang.io/mod/forum/search.php?id=7&search=24.5이미 많이 나온 질문입니다. 퍼머 링크(Permalink) 상위 보기 답글Re: 24.5 심사문제목요일, 19 8월 2021, 10:08 오후, 김 연성님이 작성 첨부해주신 링크를 보면 split한 값을 변수에 저장을 안해서 그렇다고 하셨는데 제가 작성한 코드를 보시면 x = x.split('.,')으로 저장을 했습니다. 어떤 부분을 수정해야 되는지 피드백 해주시면 감사하겠습니다. 퍼머 링크(Permalink) 상위 보기 답글Re: 24.5 심사문제금요일, 20 8월 2021, 7:06 오후, 도장_ 관리자님이 작성 http://pythontutor.com/visualize.html#code=x%3Dinput%28%29%0A%0Ax%20%3D%20x.strip%28'.,'%29%0A%0Ax%20%3D%20x.split%28%29%0A%0Acount%20%3D%200%0A%0Afor%20i%20in%20x%3A%0A%0A%20%20%20%20if%20i%20%3D%3D%20'the'%3A%0A%0A%20%20%20%20%20%20%20%20count%20%3D%20count%20%2B%201%0A%0Aprint%28count%29&cumulative=false&curInstr=206&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%22I%20dropped%20my%20eyes,%20then,%20to%20the%20foot%20of%20the%20wall--and%20I%20leaped%20into%20the%20air.%20There%20before%20me,%20facing%20the%20little%20prince,%20was%20one%20of%20those%20yellow%20snakes%20that%20take%20just%20thirty%20seconds%20to%20bring%20your%20life%20to%20an%20end.%20Even%20as%20I%20was%20digging%20into%20my%20pocked%20to%20get%20out%20my%20revolver%20I%20made%20a%20running%20step%20back.%20But,%20at%20the%20noise%20I%20made,%20the%20snake%20let%20himself%20flow%20easily%20across%20the%20sand%20like%20.the%20dying%20spray%20of%20a%20fountain,%20and,%20in%20no%20apparent%20hurry,%20disappeared,%20with%20a%20light%20metallic%20sound,%20among%20the%20stones.%22%5D&textReferences=false파이썬 시각화에서 실행해보면 결과는 8입니다.위 시각화에서 Ctrl + F를 누르고 검색에서 "the"로 검색해보면 8개입니다.에디터에서 검색해보면 the가 9개 있습니다.따라서 로직상 오류가 있습니다. 퍼머 링크(Permalink) 상위 보기 답글
Re: 24.5 심사문제목요일, 19 8월 2021, 10:08 오후, 김 연성님이 작성 첨부해주신 링크를 보면 split한 값을 변수에 저장을 안해서 그렇다고 하셨는데 제가 작성한 코드를 보시면 x = x.split('.,')으로 저장을 했습니다. 어떤 부분을 수정해야 되는지 피드백 해주시면 감사하겠습니다. 퍼머 링크(Permalink) 상위 보기 답글Re: 24.5 심사문제금요일, 20 8월 2021, 7:06 오후, 도장_ 관리자님이 작성 http://pythontutor.com/visualize.html#code=x%3Dinput%28%29%0A%0Ax%20%3D%20x.strip%28'.,'%29%0A%0Ax%20%3D%20x.split%28%29%0A%0Acount%20%3D%200%0A%0Afor%20i%20in%20x%3A%0A%0A%20%20%20%20if%20i%20%3D%3D%20'the'%3A%0A%0A%20%20%20%20%20%20%20%20count%20%3D%20count%20%2B%201%0A%0Aprint%28count%29&cumulative=false&curInstr=206&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%22I%20dropped%20my%20eyes,%20then,%20to%20the%20foot%20of%20the%20wall--and%20I%20leaped%20into%20the%20air.%20There%20before%20me,%20facing%20the%20little%20prince,%20was%20one%20of%20those%20yellow%20snakes%20that%20take%20just%20thirty%20seconds%20to%20bring%20your%20life%20to%20an%20end.%20Even%20as%20I%20was%20digging%20into%20my%20pocked%20to%20get%20out%20my%20revolver%20I%20made%20a%20running%20step%20back.%20But,%20at%20the%20noise%20I%20made,%20the%20snake%20let%20himself%20flow%20easily%20across%20the%20sand%20like%20.the%20dying%20spray%20of%20a%20fountain,%20and,%20in%20no%20apparent%20hurry,%20disappeared,%20with%20a%20light%20metallic%20sound,%20among%20the%20stones.%22%5D&textReferences=false파이썬 시각화에서 실행해보면 결과는 8입니다.위 시각화에서 Ctrl + F를 누르고 검색에서 "the"로 검색해보면 8개입니다.에디터에서 검색해보면 the가 9개 있습니다.따라서 로직상 오류가 있습니다. 퍼머 링크(Permalink) 상위 보기 답글
Re: 24.5 심사문제금요일, 20 8월 2021, 7:06 오후, 도장_ 관리자님이 작성 http://pythontutor.com/visualize.html#code=x%3Dinput%28%29%0A%0Ax%20%3D%20x.strip%28'.,'%29%0A%0Ax%20%3D%20x.split%28%29%0A%0Acount%20%3D%200%0A%0Afor%20i%20in%20x%3A%0A%0A%20%20%20%20if%20i%20%3D%3D%20'the'%3A%0A%0A%20%20%20%20%20%20%20%20count%20%3D%20count%20%2B%201%0A%0Aprint%28count%29&cumulative=false&curInstr=206&heapPrimitives=nevernest&mode=display&origin=opt-frontend.js&py=3&rawInputLstJSON=%5B%22I%20dropped%20my%20eyes,%20then,%20to%20the%20foot%20of%20the%20wall--and%20I%20leaped%20into%20the%20air.%20There%20before%20me,%20facing%20the%20little%20prince,%20was%20one%20of%20those%20yellow%20snakes%20that%20take%20just%20thirty%20seconds%20to%20bring%20your%20life%20to%20an%20end.%20Even%20as%20I%20was%20digging%20into%20my%20pocked%20to%20get%20out%20my%20revolver%20I%20made%20a%20running%20step%20back.%20But,%20at%20the%20noise%20I%20made,%20the%20snake%20let%20himself%20flow%20easily%20across%20the%20sand%20like%20.the%20dying%20spray%20of%20a%20fountain,%20and,%20in%20no%20apparent%20hurry,%20disappeared,%20with%20a%20light%20metallic%20sound,%20among%20the%20stones.%22%5D&textReferences=false파이썬 시각화에서 실행해보면 결과는 8입니다.위 시각화에서 Ctrl + F를 누르고 검색에서 "the"로 검색해보면 8개입니다.에디터에서 검색해보면 the가 9개 있습니다.따라서 로직상 오류가 있습니다. 퍼머 링크(Permalink) 상위 보기 답글