菜鸟教程 -- 学的不仅是技术,更是梦想!

Python 基础教程
(追記) (追記ここまで)

Python 练习实例77

Python 100例 Python 100例

题目:循环输出列表

程序分析:无。

程序源代码:

实例

#!/usr/bin/python # -*- coding: UTF-8 -*- if__name__ == '__main__': s = ["man","woman","girl","boy","sister"]foriinrange(len(s)): prints[i]

以上实例输出结果为:

man
woman
girl
boy
sister

Python 100例 Python 100例

AI 思考中...

2 篇笔记 写笔记

  1. #0

    上善若水

    131***[email protected]

    14

    参考方法:

    #!/usr/bin/python
    # -*- coding: UTF-8 -*-
    if __name__ == '__main__':
     x = ['apple','orange','balala']
     for i in x:
     print i
    

    上善若水

    131***[email protected]

    9年前 (2017年05月19日)
  2. #0

    Webben

    web***@foxmail.com

    7

    参考方法:

    #!/usr/bin/python
    # -*- coding: UTF-8 -*-
     
    if __name__ == '__main__':
     s = ["man","woman","girl","boy","sister"]
     l,i = len(s),0;
     while( i < l):
     print s[i];
     i = i+1;
    

    Webben

    web***@foxmail.com

    9年前 (2017年07月28日)

点我分享笔记

  • 昵称 (必填)
  • 邮箱 (必填)
  • 引用地址

AltStyle によって変換されたページ (->オリジナル) /