【三】Python List列表,及切片
2017-01-06 22:28
267 查看
H='abcdefghijklmnopqrstuvwxyz'
n=0
for x in list(H):
n=n+1
if n%2 == 0:
print ",",
else:
print x,
print
n=0
while n<len(H):
if n%2==1:
H = H.replace( H[n:n+1],',')
n=n+1
print H
n=0
for x in list(H):
n=n+1
if n%2 == 0:
print "_",
else:
print x,
print
H='abcdefghijklmnopqrstuvwxyz'
#n=0
#for x in list(H):
# print x,
# n=n+1
# if n%4 == 0:
# print
# if n%4 !=0:
# print
# while x<4-(n%4)
# print *
#H='abcdefghijklmnopqrstuvwxyz'
#n=0
#while n<26:
n=0
for x in list(H):
n=n+1
if n%2 == 0:
print ",",
else:
print x,
n=0
while n<len(H):
if n%2==1:
H = H.replace( H[n:n+1],',')
n=n+1
print H
n=0
for x in list(H):
n=n+1
if n%2 == 0:
print "_",
else:
print x,
H='abcdefghijklmnopqrstuvwxyz'
#n=0
#for x in list(H):
# print x,
# n=n+1
# if n%4 == 0:
# if n%4 !=0:
# while x<4-(n%4)
# print *
#H='abcdefghijklmnopqrstuvwxyz'
#n=0
#while n<26:
相关文章推荐
- 深入解析Python中的list列表及其切片和迭代操作
- Python列表list操作符实例分析【标准类型操作符、切片、连接字符、列表解析、重复操作等】
- 深入解析Python中的list列表及其切片和迭代操作
- python中的列表(list) 切片详解
- python之list列表、字典、元组、切片
- python中list(列表)、元组和array的区别-分别什么时候使用?
- Python 列表(list)、字典(dict)、字符串(string)常用基本操作小结
- Python中对列表list求交集
- Python中list的切片细节
- Python体验(03)-列表list和元组tuple
- python列表的切片操作
- python学习笔记——列表(list)和元组(tuple)
- python 中 列表(list)和字典(dict)数据排序
- Python一天入门8:数据结构-列表list
- 集合 (set) 与列表 (list) 分类: python 2013-01-18 15:22 292人阅读 评论(0) 收藏
- python中列表(list)和字典(dict)数据排序
- Python 列表(list)操作
- Python 列表 list 数组 array 常用操作集锦
- Python 列表(list)操作
- 列表(list)和字典(dict)数据排序 Python