Python command line argument semicolon-loop error
First, for those who only noticed python and semicolon in the title and
want to furiously bash me up, I deeply apologize, and this is only in the
command mode
I was trying out python -mtimeitso I put python -mtimeit "n = 0; while n <
10: pass" Then an invalid syntax error showed up. same with semicolon and
for loop.
However, when I try semicolon and loop individually. Both worked fine.
python -c "for i in range(10): print(n)"
python -c "n = 1; n = 2; print(n)"
Why is this so and how can I test while loop in timeit? Thank you very much!
No comments:
Post a Comment