the assignment is to create a function that calculates mode without using any built in libraries, and for some reason, mine doesn't print anything. no error messages or anything.
def find_mode(list):
counts = {}
for item in list:
if item in counts:
counts[item] += 1
else:
counts[item] = 1
theMode = max(counts.values())
return theMode
def main():
data = [1, 2, 2, 3, 3, 3, 4]
listMode = find_mode(data)
print("Mode:", listMode)```