FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-challenge/Level 2.py at master · sinjoysaha/python-challenge · GitHub
sinjoysaha
/
python-challenge
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-challenge
/
Level 2.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
38 lines (27 loc) · 673 Bytes
Breadcrumbs
python-challenge
/
Level 2.py
Copy path
File metadata and controls
38 lines (27 loc) · 673 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
28
29
30
31
32
33
34
35
36
37
38
import
urllib
.
request
url
=
"http://www.pythonchallenge.com/pc/def/ocr.html"
response
=
urllib
.
request
.
urlopen
(
url
)
html
=
response
.
read
()
print
(
response
)
# print(html)
print
(
"
\n
Printing First few characters (from 500 to 2500):
\n
"
)
print
(
html
[
500
:
2500
])
ss
=
str
(
html
[
500
:])
# print(ss)
print
(
"
\n
Checking character frequency:
\n
"
)
l
=
[]
for
i
in
range
(
256
):
l
=
l
+
[
0
]
for
i
in
ss
:
ch
=
ord
(
i
)
l
[
ch
]
+=
1
for
i
in
range
(
256
):
if
l
[
i
]
>
0
:
print
(
chr
(
i
)
+
" : "
+
str
(
l
[
i
]))
rl
=
"!#$%&()*+@[\]^_n{}"
new_ss
=
""
for
i
in
ss
:
if
i
not
in
rl
:
new_ss
+=
i
print
(
"
\n
Answer:
\n
"
)
print
(
new_ss
)
Back
|
FazBrowse Home
|
New Git URL