The mistake in line 10 is missing an indentation. The code should be indented to indicate that it is part of the if statement block. Here is the corrected code:
if choice == "1":
print("You look around the room and find a key on the floor!")
has_key = True
elif choice == "2":
if has_key:
print("You already searched the dresser and found nothing.")
else:
print("You search the dresser and find a key!")
has_key = True
else:
print("Invalid choice. Please enter 1 or 2.")