fork download
  1. def main():
  2. def power(a,b):
  3. ans = 1
  4. while(b):
  5. if b&1:
  6. ans = ans * a
  7. a = a * a
  8. b = b >> 1
  9. return ans
  10. a = 2
  11. b = 3
  12. print(power(a,b))
  13. main()
Success #stdin #stdout 0.1s 14092KB
stdin
Standard input is empty
stdout
8