Problem with inputs

I’m a complete newbie to using Python, and I haven’t actually had the opportunity to use it yet as nothing that I input is being read or executed properly for some unknown reason that I can’t figure out. Can someone tell me why I’m seeing this error no matter what I input into CMD?
Here’s the code in question:

C:\Users\macai>C:> py -m ensurepip --upgrade

C:\Users\macai>py
Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32
Type “help”, “copyright”, “credits” or “license” for more information.

C:> py -m ensurepip --upgrade
File “”, line 1
C:> py -m ensurepip --upgrade
^
SyntaxError: invalid syntax
python -m ensurepip
File “”, line 1
python -m ensurepip
^^^^^^^^^
SyntaxError: invalid syntax
C:> py pip.pyz --help
File “”, line 1
C:> py pip.pyz --help

This is not a problem with understanding Python; it’s a problem with understanding 1) CMD itself, and 2) how people present examples for CMD.

What should happen is:

C:\Users\macai>py -m ensurepip upgrade

Which is to say: you open the CMD prompt, and type py -m ensurepip upgrade at the prompt and hit the enter key.

You don’t type C:> or anything else like that in front; when you see that in examples, that’s to tell you that the example is something to type at CMD.

You don’t type it after running py, because the point of running py is to start a Python interpreter, and the command is not Python code.

See also:

Wow, thank you so much! This addresses my issue exactly and it was very timely. Thank you again, Karl!