import random print(int(random.random)) 错误如下: 解决办法: 在其后加个括号 import random print(int(random.random()))