Being given by random.randint function 'str' object can not be interpreted as an integer problem

range () int value as the only parameter. So error.

original:

n=input("輸入")

 

Solution:

1.eval() 

n=eval(input("輸入"))

 

2. Use the int ()

n=int(input("輸入"))

Guess you like

Origin www.cnblogs.com/claudia529/p/12078445.html