Python中文
首页
教程
问答
标签
搜索
登录
注册
为什么在python中使用x=list[0:8]创建列表是错误的?
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>为什么用这个创建一个列表是错误的?你知道吗</p> <pre><code>x = list[0:8] </code></pre> <p>要在两个值之间创建一个列表,这是唯一的方法吗?你知道吗</p> <pre><code>list(range(0, 8)) </code></pre> <p>谢谢</p>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>@nilsinelabore,<code>[x:y]</code>表示从索引x到y-1对列表进行切片,只有在列表存在时才能对其进行切片。你知道吗</p>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
在python中使用pandas将日志或文本文件转换为数据帧
6 回答
在python中使用pandas或dask高效地读取大型csv文件
9 回答
在Python中使用pandas或numpy进行列到列的匹配
9 回答
在python中使用Pandas打印CSV文件时出现问题
10 回答
在Python中使用Pandas打印列的索引
1 回答
在Python中使用Pandas拆分数据集
10 回答
在python中使用pandas按多索引分组而不丢失索引
1 回答
在python中使用pandas按结构化顺序打印网页中的表
5 回答
在python中使用pandas操作大文本文件时出现问题
3 回答
在Python中使用Pandas数据帧Date正在转换为timestamp
10 回答
在Python中使用pandas数据帧中的时间序列数据,如何计算具有相同日期的列的总和
2 回答
在python中使用pandas时,如何按降序排序?
3 回答
在python中使用pandas时出错
4 回答
在python中使用pandas时如何修复“属性错误”
6 回答
在python中使用pandas映射列上匹配的字数
9 回答
在python中使用pandas映射带有dataframe列的关键字
7 回答
在python中使用pandas映射带有数据帧列的关键字
8 回答
在Python中使用Pandas显示输出CSV
1 回答
在python中使用pandas有条件地连接数据帧
4 回答
在python中使用pandas根据其他列中给定的值选择列
3 回答