if len(user_hash) > 0: with open(log_file, \"w\") as log_f: for name in user_hash: log_f.write(\"Name:%s \\n Email: %s\" % (name, email) else l
if and else must be in the same column align, this work for me.