Skip to content
Advertisement

Tag: execution

Why time taken to execute code changes with one line?

This is my first code: This is my second code: This is my third code: I don’t understand why replacing s with set(s) in 4th line takes less time to execute and replacing with set(s[:]) is even more better than the other two statements. Can anyone help me to know why this happens? Answer After performing %timeit I found that

Advertisement