我遇到了編寫代碼字遊戲(也稱爲替換字符)程序的問題,並且不斷收到錯誤'str '對象不可調用。這是我的代碼(while循環它涉及到這本字典的只是一部分:TypeError:'str'對象不可打印,用於在while循環內打印字典
used_pairings = {}
while.....:
used_pairings[guesschar] = guessletter
print = ("At this point you can decide whether to delete a character-letter pairing.")
used_pairings_choice = input("Type 1 to delete a pairing or ENTER to carry on: ")
if used_pairings_choice == "1":
print ("These are your pairings so far:")
print (used_pairings)
else:
print ("Continuing program.")
這是我的錯誤:
"Codeword.py", line 79, in <module>
print ("These are your pairings so far:")
TypeError: 'str' object not callable
我在賠率完全是爲了這意味着什麼爲什麼我收到此錯誤消息,所以任何幫助,將不勝感激。在此先感謝!
這是蟒蛇2還是3? 'while .......'是怎麼回事? – Holloway
這是蟒蛇3.3.3和while ....是其中的替換字符發生的事情(這完美的作品)的程序的其餘部分 – lemurofawesomeness
錯誤的三個致命錯誤?我們有一個密切的原因,請使用它... – l4mpi