'Tuple'对象不可调用[关闭]

问题描述 投票:-2回答:1
values = input("Input some comma separated numbers : ")
list = values.split(",")

t = tuple(list)
print('List : ',list)

print('Tuple : ',t)

我是这个python编码的新手。我收到以下错误消息:

  File "<ipython-input-20-468ee1aebace>", line 1, in <module>
    t = tuple(list)
TypeError: 'tuple' object is not callable

有人可以帮我解决这个问题吗?

python tuples
1个回答
-2
投票

我在我的文本编辑器中复制了您的代码,效果很好。enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.