美文网首页
Python Challenge[28]

Python Challenge[28]

作者: Recgat | 来源:发表于2017-03-03 21:29 被阅读0次

[Level 28]


Title: many pairs ring-ring

RING-RING-RING say it out loud,但没say出什么来。

green。green.html显示yes! green!。取出G通道的数据,成对相减大多数的绝对值为42,那么搜集绝对值不是42的数值,转换为 ascii 码。

from PIL import Image
img = Image.open('bell.png')
data = [d[1] for d in img.getdata()]
s = [abs(data[i]-data[i+1]) for i in range(0,len(data),2) if abs(data[i]-data[i+1])!=42]
print(bytes(s).decode())

得到:

whodunnit().split()[0] ?

whodunnit -> "Who [has] done it?" or "Who did it"。Python的作者是Guido van Rossum,所以是guido[Level 29]

小结

可以这样取出G通道的数据:
data = list(im.split()[1].getdata())
或这样取出绝对值不为42的数据:

diff = [abs(a - b) for a, b in zip(green[0::2], green[1::2])]
filtered = list(filter(lambda x: x != 42, diff))

Python Challenge Wiki

相关文章

  • Python Challenge[28]

    [Level 28] Title: many pairs ring-ring RING-RING-RING say...

  • Python挑战:00~03关

    Python Challenge Python Challenge 00 网址: http://www.pytho...

  • 57: A Challenge

    a challenge 07/28/2017 There is a big challenge in front ...

  • Python挑战:04-05关

    Python Challenge Python Challenge 04 现在,我们来挑战第四关,从第三关的结果,...

  • 【早安心语】

    【2022-2-28】 早安 春夏秋冬 Life is a challenge, but it is not to...

  • processing 变形球 X 极光

    Based on Coding Challenge #28 1. 发光球球 # 发光 index = x + y*...

  • The Python Challenge(5)

    问题链接 问题链接如下: 答案链接 答案链接如下: 解题思路 根据页面源码提示: 再点击页面图片显示: 可知是需要...

  • The Python Challenge(8)

    问题链接 问题链接如下: 答案链接 答案链接如下: 解题思路 页面和源码中无任何提示,但图片中有一条很明显的灰度线...

  • The Python Challenge(9)

    问题链接 问题链接如下: 答案链接 答案链接如下: 登陆用户名密码为huge和file。 解题思路 阅读源码有如下...

  • The Python Challenge(2)

    问题链接 问题链接如下: 答案链接 答案链接如下: 解题思路 将页面给定的字符串根据给定规则进行替换即可,规则如下...

网友评论

      本文标题:Python Challenge[28]

      本文链接:https://www.haomeiwen.com/subject/cbdrgttx.html