简体   繁体   中英

ValueError: too many values to unpack (expected 2) due to entrance value in python

I am trying to call the function add_site. But each time, i tried the python console returns ValueError: too many values to unpack (expected 2). My code is below. Each print function is verified with success. Instance and solution are dictionnaries and the others are array or list.

call to the function

definition of the function add_site

How to solve this problem? Thank you for your help.

The reason is that you are returning only one variable instead of two in the first if condition when it is set to True.

Also, you should add your code as text instead of images so it's easier for us to have a look.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM