Welcome to stack overflow! Let's see what happens. I added links for further reading along the way, take a look at them before asking additional questions.
for incident in soup('td', width="90%"):
incident is just an arbitrary local variable for iterability returned by soup . Generally speaking, the local variable in for statement is probably a list, but can be a tuple or even a string. If it is possible to iterate over something, such as a file, then Python will probably accept for to view the elements.
In this case, soup returns a list of td HTML elements with a width of 90%. We can see this because of what happens on the following line:
where, linebreak, what = incident.contents[:3]
where , linebreak and what are also arbitrary local variables. All of them are appointed in one application. In Python, this is called multiple assignment . Where do these three elements come from? incident.contents[:3] queries the first three elements using a notation fragment .
print where.strip() print what.strip()
These two lines print on the where and what screen. But what does strip do? This is removing the space. So, " some text " will become "some text" .
break
break just breaks the for loop after the first loop. This does not violate the entire program. Instead, it returns the program stream to the next line after the loop.
print 'done'
It just does what it says, sending the words "done" to the screen. If you use this program, you know that it is completed when you see "done" (without quotes) on the screen.
ยน To be more technically accurate, they send bytes to the standard version (usually called stdout).