Saturday, 19 October 2013

Write short codes in Python - Part 5

1) Best way to take 2 integer inputs in one line in Python

      n,k=map(int,raw_input().split())

                        vs

      n,k=raw_input().split()
      n=int(n)
      k=int(k)

2) ~-x&x                  vs              (x-1)&x