I want to make a function that finds out if a given number is in a list of lists of numbers. How do I fix the following code so that it works for a list consisting of lists?
lst = [[1, 2], [3, 4],[5, 6, 7]]
num = 9
def in_list_of_list(lst: list) -> bool:
i = 0
while i < len(lst) and lst[i] != num:
i = i + 1
return i < len(lst)
print(in_list_of_list(lst))