강의

멘토링

커뮤니티

Inflearn Community Q&A

syoon084128's profile image
syoon084128

asked

[Renewed] Python Introduction and Web Scraping Basics Bootcamp [Python, Web, Data Understanding Fundamentals] (Updated)

strip 활용 문제중 이해가 안되 질문드립니다.

Written on

·

266

0

아래 보시면 code.strip(' \n')에서 괄호 안에 \n 앞에 스페이스를 넣지 않을경우 정확한 답이 안나와 왜 꼭 스페이스를 넣어야 되는지 궁금해 여쭙니다.

strip웹-크롤링python

Answer 1

0

funcoding님의 프로필 이미지
funcoding
Instructor

안녕하세요. 파이썬 strip 함수는 맨끝 맨앞의 글자가 매칭이 될 경우, 해당 글자를 삭제하는 기능을 하기 때문에, 맨 끝에 스페이스가 있으면 스페이스를 넣어줘야 할 것 같아요. 파이썬 strip 으로 검색해서, 다음과 같은 또다르게 정리된 글도 읽어보시면 좀더 이해하시는데 도움이 되실 것 같아요. 

https://wikidocs.net/33017

감사합니다.

syoon084128's profile image
syoon084128

asked

Ask a question