byte code

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, second = 0, 1 while n: #temp = second #second = current + second #current = temp current, second = second, current + second # 2 tuples tuple no need () n -= 1 # n= n-1 return current dis.dis(fib1) print(fib1.__code__) print(fib1.__code__.co_consts) print(fib1.__code__.co_varnames) print(fib1.__code__.co_code) print(dir(fib1))
Editor Settings
Theme
Key bindings
Full width
Lines