0

Why does this work?

On the first question of the else statements section in the Python3 lesson, there’s a question that requires you to run an operation and say the output. However, the output of what I’m using (repl.it) and the correct answer are entirely different. Repl doesn’t give an output, but SoloLearn says it should say ā€œelseā€. It would be greatly appreciated if someone could explain what’s happening.

21st Jun 2018, 3:49 PM
Splatonika
Splatonika - avatar
1 Answer
+ 5
Splatonika I tried it on repl.it and the output was else. Are you sure you copied the code correctly? I used: if 1 + 1 == 2: if 2 * 2 == 8: print("if") else: print("else")
21st Jun 2018, 4:01 PM
David Ashton
David Ashton - avatar