Consider the following code block:
if not x.startswith("+"): is_valid = False is_complete = None else: if len(x) > 20: if x[-1] != "+": is_valid = True else: is_valid = False is_complete = True else: is_complete = False is_valid = False print(is_complete) print(is_valid)
Define a string variable called x
such that running the code block above prints
True
False
Note: the logic in the code block above is a bit convoluted, but the purpose if to force you to think through what is happening in the different conditionals.