我得到“ValueError:randrange()的非整数停止”。我如何解决这个问题?为什么random.randint()会给出ValueError?
这是我的代码:
# Bunnies and Badgers (github.com/Zwengel/PythonGame)
import pygame, random
width, height = int(pygame.display.Info().current_w), int(pygame.display.Info().current_h)
badheight1 = height/9.6
badheight2 = height/1.12
badheight = random.randint(badheight1, badheight2)
'我该如何解决这个问题?使用整数,如错误提示... – njzk2
是不是已经是一个整数? – wb9688
@ wb9688你在python3.x上? –