码迷,mamicode.com
首页 > 编程语言 > 详细

Python学习之路3?while循环

时间:2017-02-11 23:43:23      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:odi   for   while循环   标志位   tag   pytho   nbsp   学习   bin   

#_*_coding:utf-8_*_
#!/usr/bin/env python
count=0
# while count<10:
# print(‘==>‘,count)
# count+=1

# while True:
# print(‘------‘)

# for i in range(10):
# print(i)


# for i in ‘hello‘:
# print(i)

# msg=‘hello‘
# i=0
# while i<len(msg):
# print(msg[i])
# i+=1


# while 1:
# print(‘ok‘)


#循环的嵌套

# while True:
# name=input(‘username: ‘)
# if name == ‘quit‘:break
#
# print(name)
# while True:
# age=input(‘age: ‘)
#
# if age == ‘quit‘:break
#
# print(age)

# for i in range(5):
# print(‘=======第一层for‘)
# for j in range(2):
# print(‘--->‘)
# break
# print(‘->‘)

 

‘‘‘
‘第一层for‘
‘第二层for‘
‘第二层for‘

‘第一层for‘
‘第二层for‘
‘第二层for‘

 

‘‘‘


#标志位
# import sys
tag=True
while tag:
a=input("level1")
if a == ‘q‘: break
while tag:
b = input("level2")
if b == ‘q‘: break
while tag:
c=input(‘level3‘)
if c == ‘q‘: break
while tag:
d=input(‘level4‘)
if d == ‘q‘:break
# if d==‘exit‘:sys.exit()
if d == ‘exit‘:tag=False

print(‘====>‘)

Python学习之路3?while循环

标签:odi   for   while循环   标志位   tag   pytho   nbsp   学习   bin   

原文地址:http://www.cnblogs.com/Vae1242/p/6390155.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!