import random if random.choice([0, 1]): x = '' else: x = 1 if x != 1: x = x.upper() else: pass