[英]I am getting 'tuple' object is not callable as an error
brackets = set([(()())])
Stack = []
StackSize = 20
ch=(['(',')'])
arr=[]
Here I have generated a set of brackets which is showing an error. 在这里,我生成了一组显示错误的括号。 How can it be corrected?
如何纠正?
Actually, the tuple
inside your expression is being called using another tuple expression ()
实际上,表达式内的
tuple
是使用另一个元组表达式()
调用的
>>> ()()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: 'tuple' object is not callable
>>>
I think you want to create a string similar to following as string values. 我认为您想创建一个类似于以下作为字符串值的字符串。 For example:
例如:
>>> brackets = set('[','(','()','()',')',']')
它应该是
brackets = set('[','(','(',')','(',')',')',']')
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.