【三】Python List列表,及切片

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:
ide

相關文章
相關標籤/搜索