r/pythonhelp • • Mar 23 '21

Can anyone explain what it means by Time complexity of this code? Homework question

2 Upvotes

1 comment sorted by

2

u/13ass13ass Mar 23 '21

This will raise a name error exception and won’t run bc num is not defined.

That aside, can you estimate how long this code will take to run as n changes size? Eg if n is 10x larger will it take 10x longer to run? That estimate is your time complexity estimate.