#!/usr/local/bin/python2 l = [None, 1] 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)