Not running the if statement??

Wrote here such code,but when you meet Alex or Andre gives else(You wrote a completely different name),although I asked the if statement for both options.Thanks in advance!

Name = 'Anna'
Name2 = 'Alex'
Name3 = 'Andre'
print(' Anna,Alex,Andre')
answer = input('Guess which of the 3 names correct: ')
if answer == Name:
 print('Good job')
 if answer == Name2:
 print('good guess!')
 if answer == Name3:
 print('Very close :)')

else:
 print('You wrote a completely different name')
input('Press ENTER to finish')
March 19th 20 at 08:30
2 answers
March 19th 20 at 08:32
Solution
You have a problem with nesting, your code should be this

if answer == Name:
 print('Good job')
elif answer == Name2:
 print('good guess!')
elif answer == Name3:
 print('Very close :)')
else:
 print('You wrote a completely different name')
March 19th 20 at 08:34
Thanks,but I to your reply already knew how to do,but checked whether all.So thank you again)
Finished appearance:
5c991b3718db6996984800.png

Find more questions by tags Python