Explain to me how the python language works. How threads function in Python.