+ 1
Please explain the difference between the two programs
A) x=6 y=7 if x>y: print ("x is greater than y") else: print ("y is greater than x") B) x=6 y=7 if x>y: print ("x is greater than y") else: print ("y is greater than x") output of A is : syntax error in "else" output of B is : y is greater than x please explain why I get a syntax error in A
3 Respostas
+ 4
because identation.
It's a syntax error because you get the else, but you don't have an if in that code block.
0
ooh thank!
0
space before else should be removed