search

Home  >  Q&A  >  body text

python3.0报错

第一个报错是在“New files”run 之后报错
第二个报错是在shell里面,求问同一段语句,报错为什么不一样

阿神阿神2889 days ago416

reply all(2)I'll reply

  • 大家讲道理

    大家讲道理2017-04-17 17:37:52

    There are more variables on the left than on the right, similar to a, b, c, d = [1]. It seems that you click to run directly on IDLE. You need to run it with parameters in the command.

    reply
    0
  • 黄舟

    黄舟2017-04-17 17:37:52

    First, the first error description

    script, first, second, third = argv

    The unpacking error of this statement is because the argv variable is not enough to be assigned to the variable on the left, and the file needs to be executed like this

    python 24.py argv1 argv2 argv3

    When executing the file, it needs to be followed by at least three parameters

    The second error is an error indicating that multiple statements are on the same line. Multiple statements must be separated by semicolons on the same line. >>> This represents one line

    But the questioner probably wants the code in the script to run on idle, but the parameter control of sys.argv cannot be realized on idle.

    reply
    0
  • Cancelreply