Elif prints else? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Elif prints else?

If i put Sai, it prints out ... but if i put Kakashi, it prints Blop Why doesnt it print out Blup? Am i missing out some code, or putting something wrong? name = input('Whats your name? ') if input == 'Sai': print('Blup') elif name == 'Kakashi': print('Blop') else: print('...')

3rd Mar 2019, 6:32 AM
Sai
Sai - avatar
2 Answers
+ 2
Check out the first line. You are checking the variable input, not the variable 'name' Change it to if name == 'Sai':
3rd Mar 2019, 6:36 AM
Seniru
Seniru - avatar
0
thank yuu!
3rd Mar 2019, 6:37 AM
Sai
Sai - avatar