Python doesn't update

I tried to install the new python 3.12, but everytime I check its version, in cmd, it says that the version of my python is 2.7.10 and not 3.12.
Can anyone help me?

Which OS are you using? Windows, macOS, linux?

By default on many OS typing python will always run python 2.
Try typing python3.

On windows try using the py.exe command which should run python 3.12.

Please read:

If not on Windows: