Python

Python

Python

 View Only
  • 1.  python遇见的问题

    Posted Mon November 27, 2023 02:54 PM
    Python 2.7.12 (default, Sep 17 2016, 13:47:40)
    [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin
    Type "help", "copyright", "credits" or "license" for more information.
    >>>     good = "ok"
      File "<stdin>", line 1
        good = "ok"
        ^
    IndentationError: unexpected indent
    显示IndentationError,为什么


    ------------------------------
    罗岩琳 罗
    ------------------------------


  • 2.  RE: python遇见的问题

    Posted Tue November 28, 2023 10:29 AM
    Edited by Steven Xu Tue November 28, 2023 10:29 AM

    Hi,

    I believe you have an indentation at the beginning of that line of code. If you delete the whitespace before "good", the error should be fixed. 


    It should be 

    good = "ok"

    instead of

        good = "ok"

    Also, this community is mainly for python3, specifically on z/OS. It seems like you are using python 2.7, which is no longer supported. We recommend using the newer version of python instead. 

    Thanks,



    ------------------------------
    Steven Xu
    ------------------------------