Untitled

Run Settings
LanguagePython
Language Version
Run Command
import dis def fib(n): if n<= 2: return 1 print(id(fib)) return fib(n-1) + fib(n-2) dis.dis(fib) def fib1(n): if n <= 2: return n current, next = 0,1 while n: current, next = next, current + next n -= 1 return current dis.dis(fib1) def fib2(n): a, b = 0,1 result = () for _ in range (n): result += (a,) a, b= b,a +b return result dis.dis(fib2) print(fib2.__code__) print(fib2.__code__.co_consts) print(fib2.__code__.co_varnames) print(fib2.__code__.co_code) def slow_week(): seconds_per_day = 86400 return seconds_per_day * 7 def fast_week(): return 86400 * 7
Editor Settings
Theme
Key bindings
Full width
Lines