What's your favorite flow control statement in Python?
Answer | Number | |
---|---|---|
if/elif/else (e.g., if 'python' in text: print text) | 23 (17.8%) | |
for/else (e.g., for x in mylist: print x) | 14 (10.9%) | |
while/else (e.g., while x: print x, x = x - 1) | 18 (14%) | |
try/except/finally (e.g., try: action() except: print 'error' | 21 (16.3%) | |
raise (e.g., raise endSearch, location) | 5 (3.9%) | |
break (e.g., break) | 23 (17.8%) | |
continue (e.g., continue) | 25 (19.4%) |
A total of 129 people answered this question.