Solution to Python 3.10 "command not found: py" and "command not found: python"

Today I started learning Python, when trying to run a simple helloworld.py on my MacBook Air I ran into an issue. When attempting “python helloworld.py” in the terminal I got the following:

zsh: command not found python

When trying “py helloworld.py” in the terminal I similarly got the following:


zsh: command not found py

I solved this by simply doing “python3 helloworld.py”, this successfully ran my hello world.

I’m definitely not the first person to have this issue as someone in my class was having the same issue and I found this Stack Overflow answers as well https://stackoverflow.com/a/57074406/18431135