for level(attempts):
invalid syntax
for i in range(attempts):
def difficulty():
if input(“Choose a difficulty. Type ‘easy’ or ‘hard’: “) == “easy”:
level = EASY_LEVEL
else:
level = HARD_LEVEL
what is wrong here that would return typeError when you call it in other functions
Your get its because this function could be returning an None instead of a value as nothing is returned you are just assigning stuff
change level = EASY_LEVEL to return EASY_LEVEL and same with HARD_LEVEL