Skip to content

Conversation

sean424
Copy link
Contributor

@sean424 sean424 commented May 1, 2024

Please review the pull request for the Week 1 assignments. You can find details about the solutions in the comments within each file.

@dev-jonghoonpark
Copy link
Contributor

마지막 줄에 line break를 추가해주시면 좋을것 같습니다...!
https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline

@sean424
Copy link
Contributor Author

sean424 commented May 1, 2024

각 파일 마지막줄에 line break 추가하였습니다!

@DaleSeo
Copy link
Member

DaleSeo commented May 1, 2024

각 파일 마지막줄에 line break 추가하였습니다!

여전히 ⛔ 표시가 있는 걸로 봐서는 line break가 제대로 들어가지 않은 것 같습니다 😅

Shot 2024-05-01 at 16 30 23@2x

사실 이런 사소한 작업은 직접 하시기 보다는 코드 포멧팅 도구를 통해서 코드 에디터에서 저장하실 때마다 자동으로 일어나게 하는 것이 좋습니다. 파이썬에서는 Black이라는 포멧터가 많이 사용되오니 이 블로그 글을 참고 바랍니다. https://www.daleseo.com/python-black/

s = s.lower()
s = list([c for c in s
if c.isalpha() or c.isnumeric()])
s = "".join(s)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

굳이 문자열로 다시 재변환 할 필요가 있을까요? 이 줄을 지우면 그냥 리스트 간 비교가 될 것 같네요.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

문자열 변환과 리스트 변환 중복을 제거했습니다. 리트코드 홈페이지에서 실행하니 평균적으로 10% 정도 속도가 줄어들었네요!

Comment on lines 17 to 18
s = list([c for c in s
if c.isalpha() or c.isnumeric()])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이미 리스트인데, list() 함수로 감싸는 것은 불필요한 것 같습니다.

Suggested change
s = list([c for c in s
if c.isalpha() or c.isnumeric()])
s = [c for c in s
if c.isalpha() or c.isnumeric()]

@DaleSeo DaleSeo added the week1 label May 2, 2024
@DaleSeo DaleSeo added this to the week1 milestone May 2, 2024
@sean424
Copy link
Contributor Author

sean424 commented May 2, 2024

각 파일 마지막줄에 line break 추가하였습니다!

여전히 ⛔ 표시가 있는 걸로 봐서는 line break가 제대로 들어가지 않은 것 같습니다 😅

Shot 2024-05-01 at 16 30 23@2x

사실 이런 사소한 작업은 직접 하시기 보다는 코드 포멧팅 도구를 통해서 코드 에디터에서 저장하실 때마다 자동으로 일어나게 하는 것이 좋습니다. 파이썬에서는 Black이라는 포멧터가 많이 사용되오니 이 블로그 글을 참고 바랍니다. https://www.daleseo.com/python-black/

image

알려주신대로 black 이용해서 포메팅 해봤습니다. 이렇게 - 표시가 뜨지 않으면 정상적으로 처리 된 것일까요?

@DaleSeo
Copy link
Member

DaleSeo commented May 2, 2024

알려주신대로 black 이용해서 포메팅 해봤습니다. 이렇게 - 표시가 뜨지 않으면 정상적으로 처리 된 것일까요?

네 이번에는 line break가 잘 추가가 된 것 같습니다 👏👏

Copy link
Contributor

@Invidam Invidam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨어요! 깔끔하게 잘 작성해주셨네요 👍

@DaleSeo DaleSeo merged commit 33f93b2 into DaleStudy:main May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants