languages = [
"C",
"C++",
"Perl",
"Python"]
for x
in languages :
print(x);
sites = [
"Baidu",
"Google",
"Runoob",
"Taobao"]
for site
in sites :
if site ==
"Runoob":
print(
"Runoob : "+site)
break
else:
print(
"当前站点名称为" +site)
print(
"完成循环")
for i
in range(
10) :
print(i,end=
" ")
print(
"")
for j
in range(
5,
8):
print(j,end=
" ")
print(
"")
for k
in range(
0,
10,
3) :
print(k,end=
" ")
print(
"")
for m
in range(-
10, -
100, -
30) :
print(m,end=
" ")
print(
"")
a = [
'Google',
'Baidu',
'Runoob',
'Taobao',
'QQ']
for f
in range(len(a)):
print(f,a[f])
print(
"")
print(list(range(
10)))
print(
"")
sequence = [
12,
34,
34,
23,
45,
76,
89]
for i, j
in enumerate(sequence):
print(i, j)
转载于:https://www.cnblogs.com/bilaisheng/p/10210953.html