python---1 发表于 2021-5-21 19:52:51

请教,运行后没有任何回应?????

def func(listinfo):
    try:
      result = filter(lambda k: k<100 and k%2==0, listinfo)
    except Exception as err:
      return err
    else:
      return list(result)

listinfo =
assert type(func(listinfo)) == list
assert func(listinfo) ==

wp231957 发表于 2021-5-21 20:28:34

你想要啥回应

python---1 发表于 2021-5-21 20:50:38

要返回
Traceback (most recent call last):
File "C:/Users/Administrator/AppData/Local/Programs/Python/Python38/1.py", line 10, in <module>
    assert type(func(listinfo)) == list
AssertionError

怎么改????,谢谢
页: [1]
查看完整版本: 请教,运行后没有任何回应?????