def wordjumble(Wordlist, Hintlist, score):
wordchoice = getword(Wordlist, Hintlist)
high = len(wordchoice)
low = -len(wordchoice)
for i in range(10):
position = random.randrange(high,low)
print wordchoice[position]
score = wordguess(wordchoice, score)
return score
値エラーが表示されます。私のタスクは、高値と低値の間の乱数を取得することです。私の間違いはどこですか?
トレースバックは次のとおりです。
Traceback (most recent call last):
File "E:\Programming\Python\Worksheet 15\test.py", line 54, in
wordjumble(Wordlist, Hintlist, score)
File "E:\Programming\Python\Worksheet 15\test.py", line 49, in wordjumble
position = random.randrange(high,low)
File "E:\Portable Python 2.7.2.1\App\lib\random.py", line 217, in
randrange raise ValueError, "empty range for randrange() (%d,%d, %d)"
% (istart, istop, width) ValueError: empty range for randrange() (7,-7, -14)