#!/usr/local/bin/python2 l = [None, None] for v in l: if v is not None: break print v print next((v for v in l if v is not None), None)