Java Replace String Function Python Practice