[英]how to solve the error: "Value after * must be an iterable, not int" as shown in the image below
如果想给出多个参数,Join 需要一个参数,您可以将其作为列表或元组提供。
You're trying to unpack an... integer :)您正在尝试解压缩...整数:)
The asterisk operator in python is used to unpack a list, for example if you have some case like: python 中的星号运算符用于解包列表,例如,如果您有以下情况:
full_name = ["Jimi", "Hendrix"]
print("My name is", *full_name)
So in your case you passed an integer, while the operator expects an iterable such as list for example.因此,在您的情况下,您传递了一个整数,而运算符需要一个可迭代的对象,例如列表。
I think I get what you're trying to accomplish l.我想我明白了你想要完成的事情。 You are trying to put
?
你想把
?
for each field in valeur_1[0]
(I know some french 🙂).对于
valeur_1[0]
中的每个字段(我知道一些法语🙂)。
In that case you should use this在这种情况下,你应该使用这个
markers = ",".join([ "?" for _ in len(valeur_1[0]) ])
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.