补全:写一个协程
(每道题开头都有同一段:square(x) 是个协程,里面 await asyncio.sleep(0) 让出控制再返回 x*x;run_list(xs) 用 asyncio.gather 并发算每个的平方、按提交顺序回列表;run_sum 交回结果之和。判题机自带 asyncio。)
补全 square:await 让出后,交回 x 的平方。
(每道题开头都有同一段:square(x) 是个协程,里面 await asyncio.sleep(0) 让出控制再返回 x*x;run_list(xs) 用 asyncio.gather 并发算每个的平方、按提交顺序回列表;run_sum 交回结果之和。判题机自带 asyncio。)
补全 square:await 让出后,交回 x 的平方。
全部评论