python - Is while True: a suitable way to repeat a block until an accepted case is reached? -
is while true
accepted method looping on block of code until accepted case reached below? there more elegant way this?
while true: value = input() if value == condition: break else: pass # continue code here.
thank input.
that's way in python. don't need else: pass
bit though.
note, in python 2.x you're want raw_input
rather input
.
Comments
Post a Comment