"else" function not working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

"else" function not working

Everything but the "else" function works here, but I don't understand what doesn't work. I've tried indentation and line spacing, as well as elif. Does someone know what's wrong? https://code.sololearn.com/cO7AREzjp4rp/?ref=app

3rd May 2019, 1:31 AM
Code Babylon
Code Babylon - avatar
11 Answers
3rd May 2019, 1:44 AM
Jella
Jella - avatar
+ 1
~ swim ~ It just goes to the "else", then it ends. Thanks for your help
3rd May 2019, 3:14 AM
Code Babylon
Code Babylon - avatar
0
Code indent your code, you cannot compile a code like this 🙄
3rd May 2019, 1:36 AM
Werg Serium
Werg Serium - avatar
0
It works without the else.
3rd May 2019, 1:39 AM
Code Babylon
Code Babylon - avatar
0
Nope does not work either
3rd May 2019, 1:40 AM
Werg Serium
Werg Serium - avatar
0
Ident the code
3rd May 2019, 1:40 AM
Werg Serium
Werg Serium - avatar
0
I got it to work
3rd May 2019, 1:42 AM
Code Babylon
Code Babylon - avatar
0
Not the else, but everything else
3rd May 2019, 1:42 AM
Code Babylon
Code Babylon - avatar
0
Koder King, it skips right over the second input.
3rd May 2019, 1:47 AM
Code Babylon
Code Babylon - avatar
0
~ swim ~ Thank you. I'll try to keep that in mind. However, the code you suggested skips right over the "How are you?" line, allowing for two inputs with nothing to separate them. I do appreciate the ideas everyone has.
3rd May 2019, 1:52 AM
Code Babylon
Code Babylon - avatar
0
~ swim ~ That does work (though the second else isn't needed)
3rd May 2019, 2:52 AM
Code Babylon
Code Babylon - avatar