- Notifications
You must be signed in to change notification settings - Fork0
Solve Problems inhttp://www.pythonchallenge.com/
JavaProgrammerLB/pythonchallenge
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Solve Problems inhttp://www.pythonchallenge.com
- user:password@domain url
- --user=${username} --password=${password}
- wgethttp://kohsamui:thailand@www.pythonchallenge.com/pc/rock/warmup.txt
- wget --user=kohsamui --password=thailandwww.pythonchallenge.com/pc/rock/warmup.txt
result :http://www.pythonchallenge.com/pc/rock/arecibo.html
- the picture lead to->http://www.pythonchallenge.com/pc/rock/grandpa.html
- use firefox visit the url get the hint: island:country
- username:kohsamui password:thailand
result:http://www.pythonchallenge.com/pc/ring/grandpa.html
importcsv
- csv lib for handle csv tables, csv for Comma-Separated Values
- 7367 factored result: 53 and 139
result:http://www.pythonchallenge.com/pc/ring/yankeedoodle.html
- do you find these unnecessary empty lines in the source page of guido.html
result:http://www.pythonchallenge.com/pc/ring/guido.html
- use image.split() to split RGB channels
- im.bands() return number of im's channels
- ring means "green" if you visit "green.html" will get response "yes"
- whodunnit is an word means "who is the murderer"
result:http://www.pythonchallenge.com/pc/ring/bell.html auth=(repeat, switch)
- author use python2 keyword, which has some different with python3
- use assert to do assert
- tobytes() method for Image in PIL: Return image as a bytes object.
- getpalette() method for Image in PIL: Returns the image palette as a list.
result:http://www.pythonchallenge.com/pc/hex/speedboat.html
importhashlib
- we get mybroken.zip in level 24
- the decent means leopold mozart
- we have sent an email to leopold mozart in level 19
- fix the broken zip file to match the md5
result:http://www.pythonchallenge.com/pc/hex/decent.html
- lake1.html means there is a file named with lake2
- imagine how they sound
result:http://www.pythonchallenge.com/pc/hex/lake.html
importlogging
- logging helps me to do analyze
importconstant
- I put big size array in my custom constant.py, and i can import it
- the author uses "latin1" Charset
result:http://www.pythonchallenge.com/pc/hex/ambiguity.html
importthis
- rot13
- this is an undocumented module.
result:http://www.pythonchallenge.com/pc/hex/bonus.html
fromPILimportImagefromPILimportImageSequenceimportturtle,time
- use ImageSequence to get the frame number of a gif
a=10b=3print(a/b)# 3.3333333333333335print(a//b)# 2print(a%b)# 1
result:http://www.pythonchallenge.com/pc/hex/copper.html
importzlibimportbz2
- Here is aList of file signatures
result: password is redavni
importrequestsimportzipfile
- requests is a good lib for http request
- request an url with username and password
- breakpoint resume
- you shoule know a http header {"RANGE":"bytes 0-500"}
- revers
- ZIP file Magic number: none or "PK\x03\x04" or "PK\x05\x06"(empty) or "PK\x07\x08"(spanned), PK for Phil Katz
- find points in 2123456789 points
result:http://www.pythonchallenge.com/pc/hex/idiot2.html
importbase64importwave
- use base64 to decode these codes
- use wave to read and write frame
- the sea is yellow the land is blue,which is out of order
- if you email to leopold with “sorry” as subject, you will get a surprise
result:http://www.pythonchallenge.com/pc/hex/bin.htmlusername:butter password:fly
importdifflib
- the obvious different between two picture is brightness.
gunzip deltas.gz
- png file start with: 0x89 0x50 0x4E 0x47 0x0D 0x0A 0x1A 0x0A
- 0x89 is png's magic number,all jpg file start with 0xFF
- 0x50 decode in utf-8 is P, 0x4E for N, 0x47 for G
- use three tag "+", "-", " " to describe the difference between two files
when you say a php file, there are some function in it
- Loop:http://www.pythonchallenge.com/pc/def/linkedlist.php
- RPC:http://www.pythonchallenge.com/pc/phonebook.php
result:http://www.pythonchallenge.com/pc/return/balloons.html
fromhttp.cookiejarimportCookieJarimporturllib.parseimportbz2importrequests
- the small pic in left bottom director us toLevel 3
- use CookieJar to catch cookies
- use bz2 to decompress
is it the 26th already? call his father and inform him that "the flowers are on their way". he'll understand.
- 26th director us toLevel 15
- mozart‘s farther isLeopold Mozart
- call director us tophonebook in Level 12
- Level 12Bert tell us to use the first name
- inform him let us remember that the cookies are {"info":"value"}
result:http://www.pythonchallenge.com/pc/return/romance.html
fromPILimportImage
- this gif is a P mode picture which use one 8 bit number to declare a color
- straight is a way to handle these pixels
result:http://www.pythonchallenge.com/pc/return/mozart.html
fromcalendarimportisleapfromdatetimeimportdate
- year 1756 is a leap year
- 1756-1-27 is Tursday
- mozart's birthday is 1756-1-27
- mozart is the second youngest boy in his family
result:http://www.pythonchallenge.com/pc/return/uzi.html
fromPILimportImagefromPILimportImageDraw
- the key of this problem is to use 100 * 100 = 100 + 99 + 99 + 98 + 98 + 97 + 97 + ...
- the size of cat.png is 100 * 100
- use ImageDraw.point()
- result is "wire/cat.png"
while( left(0,0) -> right(99,0) 100 up(99,1) -> down(99,99) 99 right(99,98) -> left(99,0) 99 down(98,0) -> up (1,0) 98)
result:http://www.pythonchallenge.com/pc/return/italy.html
importxmlrpc.client
It's amazing that RPC tech has so much long history.
system.listMethods
This method returns a list of the methods the server has, by name.
POST below with application/xml to server.
<?xml version="1.0"?><methodCall> <methodName>phone</methodName> <params> <param> <value><string>Bert</string></value> </param> </params> </methodCall>
Question12 evil4.jpg tell us the evil is Bert(IE can open evil4.jpg or change the suffix to .txt).
result:http://www.pythonchallenge.com/pc/return/disproportional.html
use python IO to divide the gfx into 5(5 is the count of playing card in the pic) jpg files.
result:http://www.pythonchallenge.com/pc/return/evil.html
fromPILimportImagefromPILimportImageDraw
the hint is in the html'title: odd, even
result:http://www.pythonchallenge.com/pc/return/5808.html
with pycharm IDE, I can debug the code easier.
the method of find rule ofa is:look ata[i - 1], do count
1
the next is one 1: 11
the next is two 1: 21
the next is one 2 one 1: 1211
the next is one 1 one 2 two 2: 111221
the next is three 1 two 2 one 1: 312211
result:http://www.pythonchallenge.com/pc/return/bull.html
the html knowledge learn from 8 help me.
result:http://www.pythonchallenge.com/pc/return/good.html
un:huge pw:file
html knowledge: img-usemap="#--", map, area, sharp, poly, coords.
importbz2
result:http://www.pythonchallenge.com/pc/def/integrity.html
fromPILimportImage
use PIL module to find the block's pixel with getpixel(), then use chr() to translate the code
result:http://www.pythonchallenge.com/pc/def/oxygen.html
importzipfile
zip file not only can bi unzip, can contains a lot of comments.
every level will play with a new lib.
result:http://www.pythonchallenge.com/pc/def/channel.html
importpickle
every line elements add up to 96
result:http://www.pythonchallenge.com/pc/def/peak.html
importrequests
this is a http client lib with to do http request.
result:http://www.pythonchallenge.com/pc/def/linkedlist.html
transfer to:http://www.pythonchallenge.com/pc/def/linkedlist.php
result:http://www.pythonchallenge.com/pc/def/equality.html
result:http://www.pythonchallenge.com/pc/def/ocr.html
- ord()
- chr()
- isalpha()
- isalnum()
True: 'a'.isalpha()True: 'a'.isalnum()
False: '.'.isalpha()False: '.'.isalnum()
True: '1'.isalnum()False: '1'.isalpha()
pow(2,3)
About
Solve Problems inhttp://www.pythonchallenge.com/
Topics
Resources
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
Packages0
Uh oh!
There was an error while loading.Please reload this page.