1. def swap(d): new_d = {} for key in d: value = d[key] new_d[value] = key return new_d 2. def capitalized_lies(filename): file = open(filename, "r") count = 0 for line in file: if line[0].isupper(): count += 1 return count 3. True. The parameter x shadows the global variable x, so even though x gets changed inside the function, it does not affect the global variable x. 4. def better_longwinded(a, b, c): return a > b and a > c 5. def add_number_to_dict(d, number): for key in d: d[key] += number 6. def remove_upper(s): lower_s = "" for ch in s: if not ch.isupper(): lower_s += ch return lower_s