Python error handling

‘list’ object is not callable

Keywords cannot be used as variable names

Using list as the variable name, the first run can be successful, but an error will be reported the second time. After changing the variable name, the error will still be reported, because the memory space has not been released
Please add image description
del list. After the memory is released, the operation can be successful.
Please add image description

not enough values to unpack (expected 2, got 0)

No value passed

The tuples returned by zip have been converted into lists before. After decompression, there will be no zip tuples.
Insert image description here
Delete the previous list conversion, or do not assign the zip tuples to variables.
Insert image description here

too many values to unpack (expected 2)

Too many values ​​passed

zip(lis1, lis2, lis3)What is returned is a triple, but the definition of a1 and a2 is only decompressed to two dimensions, so an error will be reported. Just add more a3.

Insert image description here
Insert image description here

Guess you like

Origin blog.csdn.net/WEB___/article/details/127770366