Skip to content

Commit 2bd7edc

Browse files
11
1 parent 2ce9ce1 commit 2bd7edc

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

11.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from PIL import Image
2+
from PIL import ImageDraw
3+
4+
im = Image.open("cave/cave.jpg")
5+
size = im.size
6+
width = size[0]
7+
height = size[1]
8+
9+
odd_and_even = Image.new("RGB", [width, height], (0xff, 0xff, 0xff))
10+
drawer = ImageDraw.Draw(odd_and_even)
11+
12+
for x in range(0, width, 2):
13+
for y in range(0, height, 2):
14+
drawer.point((x, y), im.getpixel((x, y)))
15+
16+
for x in range(1, width, 2):
17+
for y in range(1, height, 2):
18+
drawer.point((x, y), im.getpixel((x, y)))
19+
20+
odd_and_even.show()

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# pythonchallenge
22
Solve Problems in http://www.pythonchallenge.com
33

4+
#### 11
5+
result: http://www.pythonchallenge.com/pc/return/evil.html
6+
```
7+
from PIL import Image
8+
from PIL import ImageDraw
9+
```
10+
the hint is in the html'title odd, even
11+
412
#### 10
513
result: http://www.pythonchallenge.com/pc/return/5808.html
614

cave/cave.jpg

125 KB
Loading

0 commit comments

Comments
 (0)