如何在Python中找到范围从1到1000的randint系列x,其中x=10。以下是我键入的程序:
for x in range(1,1000):
print( print(randint(5))
以下是我遇到的语法错误:
TypeError Traceback (most recent call last)
<ipython-input-43-f843bcdf784d> in <module>()
----> 1 print(randint(5))
TypeError: randint() missing 1 required positional argument: 'b
在
randint()
中,应该指定两个整数:开始和结束。第一个值应小于第二个值。 就你而言:这将输出0、1、2、3、4或5。你知道吗
相关问题 更多 >
编程相关推荐