One that a professor of mine used when I was in grad school which I don't see that often these days is the use of sentinel values. For arrays/lists of unknown sizes, it's sometimes nice to do something like:
while val != SENTINEL:
# ...stuff...
val = some_iterator()
You just have to be careful that you can never have real data equal the sentinel.A variation on this can be used to stop queue processing in a multi-threaded/processing environment. You can put N sentinels (aka, poison) in the queue for N readers, and when a reader gets the poison, it quits.