zoukankan      html  css  js  c++  java
  • 0X06遍历列表

    # -*- coding:utf-8 -*-
    #!/usr/bin/python
    
    '''
    一;遍历整个列表
    '''
    
    '''
    使用for循环来遍历列表内容
    '''
    
    magicians = ['alice','david','carolina']
    
    for i in magicians:
        print(i)
    
    '''
    1;在for循环中执行更多的操作
        在for 循环中,想包含多少行代码都可以。在代码行for a in magicians 后面,每个缩进的代码行都是循环的一部分,且将针对列表中的每个值都执行一次。因此,可对列表中的每个值执行任意次数的操
    '''
    
    for a in magicians:
        print(a.title() + ", that was a great trick!")
        print("I can't wait to see. your next trick, " + a.title() + ".
    ")
  • 相关阅读:
    推箱子
    为textarea增加maxlength属性(转)
    validate
    keypress
    Knockout
    & replace &
    银联参数
    chinapay
    model binding
    JSON.stringify
  • 原文地址:https://www.cnblogs.com/aaron456-rgv/p/12613237.html
Copyright © 2011-2022 走看看