0

I want to check how efficient my code is (time taken to run, and lines of code).
For example, how can I check whether this fibonacci code is efficient?

def fibonacci(start=0, end=10): a = 0 b = 1 while True: if b >= end: break a, b = b, a+b if start <= a <= end: print(a) fibonacci(start=10, end=45) 
2
  • 1
    be careful with the indentation (function body should be shifted right). Commented Dec 19, 2017 at 16:47
  • Ultimately, 'efficiency' may be about how well your program compares with others. It's probable that others have written code to do this on codegolf.stackexchange.com. You could see how your stacks up. Commented Dec 19, 2017 at 17:02

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.