Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tushar-rishav/python_challenge
Random hacks at http://www.pythonchallenge.com/
https://github.com/tushar-rishav/python_challenge
Last synced: about 2 months ago
JSON representation
Random hacks at http://www.pythonchallenge.com/
- Host: GitHub
- URL: https://github.com/tushar-rishav/python_challenge
- Owner: tushar-rishav
- Created: 2015-09-01T13:38:46.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-01T16:54:30.000Z (over 9 years ago)
- Last Synced: 2024-10-13T09:47:53.906Z (3 months ago)
- Size: 402 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# python_challenge
Random hacks at http://www.pythonchallenge.com/### Level 0
```sh
Compute 2**38 and hit at http://www.pythonchallenge.com/pc/def/274877906944.html
```
### Level 1
#####Two ways are there:######1. Run this command in your terminal
```sh
echo "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj." | tr [a-xy-z] [c-za-b]
echo "map" | tr [a-xy-z] [c-za-b]
```######2. Python script
```py
import string
tbl = string.maketrans(
"abcdefghijklmnopqrstuvwxyz", "cdefghijklmnopqrstuvwxyzab"
)st = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."
print st.translate(tbl) # i hope you didnt translate it by hand. thats what computers are for. doing it in by hand is inefficient and that's why this text is so long. using string.maketrans() is recommended. now apply on the url.
url = "map"
url = url.translate(tbl)
```
Finally hit at `http://www.pythonchallenge.com/pc/def/ocr.html`### Level 2
```py
import urllib2,re,collections
r = urllib2.urlopen('http://www.pythonchallenge.com/pc/def/ocr.html').read()[843:] # filter shit
print collections.Counter(r) # shows that only alphabets are occurring once. So let's filter them out
code = re.findall("[a-zA-Z]", r)
code = "".join(code)
print code # prints equality
```
Finally hit at `http://www.pythonchallenge.com/pc/def/equality.html`