问题
#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
How to deal with this?I am a beginner, this problem has made me crazy!
回答1:
You have definitely used a variable named print and assigned a string to it before this code.
Did you try to print like this before this code?
print = 'something,something'
That's wrong. It basically makes print a variable and when you try to call the print function it instead calls this variable which has a string stored in it.
Solution:-
Well if you are writing code in an interpreter(which is most probably what you did), just open a new one and write the correct code only. if you have a .py file, then just edit out the print = 'something'
part.
That's my guess.
All the best.
来源:https://stackoverflow.com/questions/45620669/str-object-is-not-callable-with-print