a=5;b=10;a----------------++++++++++++++++++b
# Output: 15
The above is the output of a python script. Could you please explain how it works? I was quite surprised that it works and gives an answer!!
However a similar such expression doesn't work in Java,C,C++ For instance:
a=10;
b=5;
System.out.println(a---b);//error!!
cout<<a---b;//error
printf("%d\n",a---b);//error
Does this have something to do with the compiler - lexical analyser/syntactical analyser? I understand there is a "leftmost, eager and greedy" approach taken by compilers, but I dont exactly understand how that works in this case.