python randint和range区别

区别如下图所示:

总结:randint 包含左右索引,生成一个随机整数;
range包含左索引,不包含右索引,生成一个列表。

猜你喜欢

转载自www.cnblogs.com/zhuyunbk/p/12022870.html