导致此TypeError发生的原因是什么?

时间:2017-06-11 22:43:05

标签: python-3.x

所以,我一直在研究“幸运之轮”的Python实现已经有一段时间了,经过一段时间的测试我到目前为止,它抛出了这个错误:

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    wheel_of_fortune()
  File "C:/Users/Harry/Documents/randompythonprograms/e.py", line 50, in wheel_of_fortune
    player1firstturn(player1, player2, player3, text, blank_text, letters, consonants, vowels, vwit, 0, 0, 0)
  File "C:/Users/Harry/Documents/randompythonprograms/e.py", line 190, in player1firstturn
    player1do(prize, choice, player1, player2, player3, text, blank_text, letters, consonants, vowels, vwit, player1amount, player2amount, player3amount)
  File "C:/Users/Harry/Documents/randompythonprograms/e.py", line 229, in player1do
    player1firstturn(player1, player2, player3, text, blank_text, letters, consonants, vowels, vwit, player1amount, player2amount, player3amount)
  File "C:/Users/Harry/Documents/randompythonprograms/e.py", line 87, in player1firstturn
    player1firstturn(player1, player2, player3, text, blank_text, letters, consonants, vowels, vwit, player1amount, player2amount, player3amount)
  File "C:/Users/Harry/Documents/randompythonprograms/e.py", line 167, in player1firstturn
    player2firstturn(player1, player2, player3, text, blank_text, letters, consonants, vowels, vwit, player1amount, player2amount, player3amount)
  File "C:/Users/Harry/Documents/randompythonprograms/e.py", line 439, in player2firstturn
    player2do(prize, choice, player1, player2, player3, text, blank_text, letters, consonants, vowels, vwit, player1amount, player2amount, player3amount)
  File "C:/Users/Harry/Documents/randompythonprograms/e.py", line 478, in player2do
    player2firstturn(player1, player2, player3, text, blank_text, letters, consonants, vowels, vwit, player1amount, player2amount, player3amount)
  File "C:/Users/Harry/Documents/randompythonprograms/e.py", line 416, in player2firstturn
    player3firstturn(player1, player2, player3, text, blank_text, letters, consonants, vowels, vwit, player1amount, player2amount, player3amount)
  File "C:/Users/Harry/Documents/randompythonprograms/e.py", line 723, in player3firstturn
    player3do(prize, choice, player1, player2, player3, text, blank_text, letters, consonants, vowels, vwit, player1amount, player2amount, player3amount)
  File "C:/Users/Harry/Documents/randompythonprograms/e.py", line 762, in player3do
    player3firstturn(player1, player2, player3, text, blank_text, letters, consonants, vowels, vwit, player1amount, player2amount, player3amount)
  File "C:/Users/Harry/Documents/randompythonprograms/e.py", line 693, in player3firstturn
    player1(player1choice, player1, player2, player3, text, blank_text, letters, consonants, vowels, vwit, player1amount, player2amount, player3amount)
TypeError: 'str' object is not callable

任何人都可以向我解释“错误警告”吗? 顺便说一下,到目前为止我在这里: https://gist.github.com/HarrySlaughter/d8481874ec401cb0a78defd75ad9fd72

1 个答案:

答案 0 :(得分:0)

多次错误都可能导致此错误。 看看这个。

str object not callable

如果您提供代码

会很有帮助