简体   繁体   English

我收到“元组”对象无法作为错误调用

[英]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.

相关问题 为什么我在Python中得到“&#39;tuple&#39;对象不是可调用错误” - Why am I getting "'tuple' object is not callable error in python 我在尝试操作oop时尝试运行此代码,但无法获取错误元组对象 - i am trying to run this code as i am practising oop but i getting the error tuple object is not callable TypeError: 'Tk' object is not callable 为什么我会收到此错误消息 - TypeError: 'Tk' object is not callable Why am i Getting this error message 为什么我在 python 上得到一个列表 object is not callable 错误? - Why am I getting a list object is not callable error on python? 我在这里收到错误错误是('str' object 不可调用) - I am getting errors here error is ('str' object is not callable) 为什么我得到的对象不可调用? - Why am I getting object is not callable? 返回元组给错误的元组对象是不可调用的 - Returing tuple giving an error tuple object is not callable 我收到“列表”object 不是此代码的可调用错误。 我需要在每个元素前加零 - I am getting 'list' object is not callable error for this code. I need to add zero before each element 在类模块中调用最后一个函数时,出现“无法调用的浮动对象”错误 - I am getting a “float object not callable” error when calling last function in a class module 我收到“mul 对象不可调用”-错误 - I'm getting a "mul object is not callable"-error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM