use for and if in one line python code example Example: python single line if new_value = value_when_true if condition else value_when_false