[Python] Python invalid syntax for print("Hello, world!")

Discussão em 'Python' iniciado por Stack, Agosto 28, 2025.

  1. Stack

    Stack Membro Participativo

    I don't understand why I get the error for invalid syntax for my simple code print("Hello, world!")

    I've installed Python in my pc. I'm running it on the cmd, changed my directory to the one where my file is at, but I still get an error.

    Here is what my cmd says when I get the error:

    Microsoft Windows [Version 10.0.19043.1889]
    (c) Microsoft Corporation. All rights reserved.

    C:\Users\angel>cd C:\Users\angel\OneDrive\Documentos\html css course

    C:\Users\angel\OneDrive\Documentos\html css course>py
    Python 3.10.6 (tags/v3.10.6:9c7b4bd, Aug 1 2022, 21:53:49) [MSC v.1932 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> python hello.py
    File "<stdin>", line 1
    python hello.py
    ^^^^^
    SyntaxError: invalid syntax
    >>>


    Thank you in advance.

    Continue reading...

Compartilhe esta Página