Connecting Tech Pros Worldwide Forums | Help | Site Map

Python run times

Newbie
 
Join Date: Oct 2009
Posts: 5
#1: Oct 23 '09
I have to state running times using the big-O notation. I'm not sure how you do this

Expand|Select|Wrap|Line Numbers
  1. x = 0
  2. a = 6
  3. b = 6
  4. c = 1
  5. for i in range(2*n):
  6.      x = x + c
  7.      c = c + b
  8.      b = b + a
  9. print x
  10.  
Could someone give me a hint on how I should approach this problem?

kaarthikeyapreyan's Avatar
Member
 
Join Date: Apr 2007
Location: India
Posts: 101
#2: 4 Weeks Ago

re: Python run times


Is it that your are look for the performance metrics of the loop that you are running ? there are a lot of profiling tools that are available for getting the runtime states of the python program.
Reply