You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 2, 2021. It is now read-only.
the code in listcomp_speed.py will rasise an syntax error:
def clock(label, cmd):
... res = time.repeat(cmd, setup=SETUP, number=TIMES)
... print(label, *('{:3.f}.formart(x) for x in res'))
File "", line 3
print(label, *('{:3.f}.formart(x) for x in res'))
^
SyntaxError: invalid syntax
but it doesn't make sense to me, as the asterisk in print is unpacking, and unpacking is support in print, as
print(*("1","2")) will work well.
and the same code run well in python3.5.
the book did not specify the environment of python.