I have the code:
num_for_loops = 0
for line in lines:
if line.strip().startswith('for '):
num_for_loops += 1
return num_for_loops
I need to condense it down to as little lines as possible. Is there a way to do this by combining the for and if statements? The context is irrelevant.