#python3
applicant = input("Enter the applicant's name: ")
interviewer = input("Enter the interviewer's name: ")
time = input("Enter the appointment time: ")
print(interviewer, applicant, time)
always show error:
TypeError: 'str' object is not callable
如何处理这个问题?我是初学者,这个问题让我抓狂!
在这段代码之前,您肯定已经使用了一个名为 print 的变量并为其分配了一个字符串。
在这段代码之前您是否尝试过像这样打印?
print = 'something,something'
那是错误的。它基本上使 print 成为一个变量,当您尝试调用 print 函数时,它会调用这个变量,其中存储了一个字符串。
解决方案:-
好吧,如果您在解释器中编写代码(这很可能就是您所做的),只需打开一个新解释器并仅编写正确的代码即可。如果您有 .py 文件,则只需编辑print = 'something'
部分。
这是我的猜测。
一切顺利。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)