One can write an O(n^2) that should be an O(n) algorithm in Java just as easily as Python.
Bad code is bad code. On the scale of encouraging good practices and discouraging bad ones, Python does pretty well given the very low overhead to get started-- something Java does not have.