Java and Python Code