一、循环语句两个类型
1. for x in ...
答案L = ['Bart', 'Lisa', 'Adam']
for L in L:
print("hello,",L,"!")
2. While语句
L = ['Bart', 'Lisa', 'Adam']
n = 0
while n <3:
print("hello,",L[n],"!")
n = n + 1
一、循环语句两个类型
1. for x in ...
答案L = ['Bart', 'Lisa', 'Adam']
for L in L:
print("hello,",L,"!")
2. While语句
L = ['Bart', 'Lisa', 'Adam']
n = 0
while n <3:
print("hello,",L[n],"!")
n = n + 1
本文标题:2019-06-19l廖雪峰python循环语句笔记
本文链接:https://www.haomeiwen.com/subject/ctelqctx.html
网友评论