python【列表表达式】【直接运行函数】

import time
res = [(time.sleep(1),print(i)) for i in range(10)]
print(res)
'''
[(None, None), (None, None), (None, None), (None, None), (None, None), (None, None), (None, None), (None, None), (None, None), (None, None)]
'''

原文地址:https://www.cnblogs.com/amize/p/15228567.html