what is wrong here? Flashcards
1
Q
for level(attempts):
invalid syntax
A
for i in range(attempts):
2
Q
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
A
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
3
Q
A