Newly downloaded Python 3 ... SyntaxError msg pointing to ~

Hi. I just downloaded Python 3 onto my MacBook Air per the instructions found in the link below …

https://www.codecademy.com/article/install-python3

Under the Installing Python: Mac: Advanced section, I am following the instructions to … Execute open ~/.bash_profile from a Terminal … but I am receiving the message seen below pointing to the ~ …

SyntaxError: invalid syntax

I tried using the nano command as another way to open my bash profile but am unable to get through because of the same message above. Help please?

What happens when you type:
python3 --version
?
I ask b/c I wondered if it was installed correctly.

The period before the .bash_profile denotes that it’s a hidden file.

Do you see your .bash_profile when you issue the following command:
ls -a
This will show all files, even hidden ones.

and do you still receive an error when you type:

nano ~/.bash_profile

Also, FYI, your login shell is .zsh, assuming you have an OS that is later than Catalina.
This article might be of some help: