# some basic bool examples. x = True y = False print(f"x: {x}") print(f"y: {y}") print(f"not(x): {not(x)}") print(f"x and y: {x and y}") print(f"x and not y: {x and not y}") print(f"x or y: {x or y}") print("Short circuit evaluations") li = [10,20] print(f"li[1]: {li[1]}") if li[1]: print(f"li[1]: true") else: print(f"li[1]: true") k = 4 print(f"k: {k}") try: if li[k]: print(f"li[k]: true") except IndexError: print("Index out of range error for li[k]") try: if x or li[k]: print(f"x or li[k]: true") else: print(f"x or li[k]: false") except IndexError: print("Index out of range error for 'x or li[k]'") try: if x and li[k]: print(f"x and li[k]: true") else: print(f"x and li[k]: false") except IndexError: print("Index out of range error for 'x and li[k]'") try: if y and li[k]: print(f"y and li[k]: true") else: print(f"y and li[k]: false") except IndexError: print("Index out of range error for 'y and li[k]'") try: if y or li[k]: print(f"y or li[k]: true") else: print(f"y or li[k]: false") except IndexError: print("Index out of range error for 'y or li[k]'")