Added Python ver. Minor Edit on Java Ver.

Added Python implementation
Minor changes on java implementation(commenting style and some
programming style changes)