Skip to content
Advertisement

Tag: timeit

How to timeit.timeit multi-line output without EOL error?

I have the following code stored in a .py file: This code executes perfectly fine. But now I want to measure the time it takes to execute the code. So I try to insert it into timeit.timeit in the following way: And now I get the following error: So apparently, it seems like the python code is giving me EOL

Advertisement