#!/usr/bin/python #coding=utf-8 #好好学习,天天向上 a = 1 while a <= 6: print(a) a = a + 1 -------------------------- #!/usr/bin/python #coding=utf-8 #好好学习,天天向上 a = 1 while a <= 6: a = a + 1 print(a)
for循环是为每一个元素都进行循环,while则是不断执行,当指定的条件不满足就退出
#!/usr/bin/python #coding=utf-8 #好好学习,天天向上 a = 1 while a <= 6: print(a) a = a + 1 -------------------------- #!/usr/bin/python #coding=utf-8 #好好学习,天天向上 a = 1 while a <= 6: a = a + 1 print(a)
for循环是为每一个元素都进行循环,while则是不断执行,当指定的条件不满足就退出