用Python写一个for循环的例子
Python的for循环可以循环所有序列(一个list或者string), 如:
a = ['abc', 'bcde', 'efghi', 'hello word']
for i in a:
print (i)
print (len(i))
代码在Python3.0下调试通过
a = ['abc', 'bcde', 'efghi', 'hello word']
for i in a:
print (i)
print (len(i))
代码在Python3.0下调试通过
【用Python写一个for循环的例子】相关文章
3. 请用Python写一个获取用户输入数字,并根据数字大小输出不同信息的脚本
8. 用Python匹配HTML tag的时候,<.*>和<.*?>有什么区别
9. 触发器(trigger)的功能都有哪些?写出一个触发器的例子
10. Python里面如何拷贝一个对象
本文来源:https://www.mianshiwenti.com/a13512.html
进入下载页面
上一篇:Python面试题集
下一篇:介绍一下Python下range()函数的用法
﹝用Python写一个for循环的例子﹞相关内容
- Python中如何定义一个函数
- 请写出一段Python代码实现删除一个list里面的重复元素
- Python如何定义一个函数
- 软件测试LoadRunner面试题:What is think time? How do you change the threshold?
- Python里面search()和match()的区别
- 华为python面试题
- Python的两道面试题
- Python是如何进行类型转换的
- Python文件操作的面试题
- Python里面如何实现tuple和list的转换