比奥数题还脑残的Python题
Posted | archive
下边的问题是在CPython interactive shell 里按顺序执行的,请在 下划线处 ____ 填上答案。
>>> x = [1, 2, 3]
>>> for number in x:
... number += 1
...
>>> print x
__________________
>>> print 1 == True
__________________
>>> print 0 == False
__________________
>>> print 2 == True
__________________
>>> item = 'x'
>>> print item == "y" or "z"
___________________
>>> l = [1,6,4,2,3,9,4,6]
>>> l = l.sort()
>>> print l
___________________
>>> ll = [lambda: n for n in range(5)]
>>> print [l() for l in ll]
___________________
>>> my_gen = (i for i in range(10))
>>> print(3 in my_gen)
___________________
>>> print(7 in my_gen)
___________________
>>> print(2 in my_gen)
___________________
Comments