0w0
[pythonchallenge] level2 본문
level2
recognize the characters. maybe they are in the book,
but MAYBE they are in the page source.
구글 번역기
문자를 인식하고 있습니다. 아마 그들은 책에,
하지만 어쩌면 그들은 페이지 소스에 있습니다.
페이지 소스를 보도록 하겠습니다.
주석으로 처리되어있는 이해하기 힘든 문자들 사이에 희귀하게 있는 문자를 찾으라고합니다.
알파벳이 이해불가 문자들 사이에 숨어있을 것으로 보입니다.
<--find rare characters in the mess below:-->
문자를 찾아보도록 하겠습니다.
소스 !!!
odi="""생략""" #주석으로 되어있는 문자들의 부분을 넣어줍니다.
modi=""
for i in range(len(ori)):
if ori[i].isalpha():
modi=modi+ori[i]
print(modi)
문자열 중에서 알파벳만을 추출해서 값을 확인합니다.
http://www.pythonchallenge.com/pc/def/ocr.html 에서 ocr 부분을 equality로 고쳐서 이동하시면 됩니다.
http://www.pythonchallenge.com/pc/def/equality.html
import urllib
import string
import re
res= urllib.urlopen('http://www.pythonchallenge.com/pc/def/ocr.html')
source = res.read()
encode = source[source.rindex('<!--'):source.rindex('-->')]
print(encode)
print(re.sub("[^a-z]",'',encode))
#파이썬 챌린지 2번으로 생각해보는 문자열 나누기
'Coding > pythonchallenge' 카테고리의 다른 글
[pythonchallenge] level4 (0) | 2019.09.08 |
---|---|
[pythonchallenge] level3 (0) | 2019.09.03 |
[pythonchallenge] level0 level1 (0) | 2016.09.17 |