Random module not working. ValueError: empty range for randrange() (1,1, 0)
问题 In Python 2.7.1, I import the random module. when I call randint() however, I get the error: ValueError: empty range for randrange() (1,1, 0) This error is caused by an error in the random.py module itself. I don't know how to fix it, not does reinstalling python help. I can't change versions. can someone please give me code for a working module or tell me what to do? 回答1: You called randint like this: randint(1,0) That tells randint to return a value starting as 1 and ending at 0. The range