0w0

[pythonchallenge] level3 본문

Coding/pythonchallenge

[pythonchallenge] level3

0w0 2019. 9. 3. 03:24
728x90
반응형

- 문제

One small letter, surrounded by EXACTLY three big bodyguards on each of its sides.

그 양쪽에 정확히 세 명의 큰 경호원들이 둘러쌓인 작은 편지 한 통.

 

 

- 소스코드 내 주석 정보 확인

 

- 코드

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
 
 
import sys,io
 
 
from urllib import request as req
import re
 
html=req.urlopen('http://www.pythonchallenge.com/pc/def/equality.html').read()
html=str(html)  #print(type(html)) #<class 'bytes'>
 
ori_text=re.findall('<!--\n?(.*)\n?-->',html)
ori_text=str(ori_text)  #print(type(ori_text))   #<class 'list'>
 
 
p=re.compile('[a-z][A-Z]{3}[a-z][A-Z]{3}[a-z]')
 
#get_text=p.findall(html)
get_text=p.findall(ori_text)
 
print(get_text)
 
for i in get_text:
    print(i[4], end='')
 
 
 
cs

 

 

 

- 출력 결과

['qIQNlQSLi', 'eOEKiVEYj', 'aZADnMCZq', 'bZUTkLYNg', 'uCNDeHSBj', 'kOIXdKBFh', 'dXJVlGZVm', 'gZAGiLQZx', 'vCJAsACFl', 'qKWGtIDCj']
linkedlist

 

 

- level4

www.pythonchallenge.com/pc/def/linkedlist.html

-> www.pythonchallenge.com/pc/def/linkedlist.php 

 

728x90
반응형

'Coding > pythonchallenge' 카테고리의 다른 글

[pythonchallenge] level4  (0) 2019.09.08
[pythonchallenge] level2  (0) 2016.09.19
[pythonchallenge] level0 level1  (0) 2016.09.17
Comments