t462.py 426 B

12345678910111213141516171819202122232425
  1. def helper(func,x):
  2. print func(x), func(-x), func(long(x)), func(-long(x))
  3. big = 123456789123456789123456789123456789
  4. print "\nHEX"
  5. helper(hex,10)
  6. helper(hex,0xff)
  7. helper(hex,034)
  8. helper(hex,0b1110011)
  9. helper(hex,big)
  10. print "\nOCT"
  11. helper(oct,10)
  12. helper(oct,0xff)
  13. helper(oct,034)
  14. helper(oct,0b1110011)
  15. helper(oct,big)
  16. print "\nBIN"
  17. helper(bin,10)
  18. helper(bin,0xff)
  19. helper(bin,034)
  20. helper(bin,0b1110011)
  21. helper(bin,big)