At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
>>> x = 15 >>> if (x/2)*2 ==x: print "even" SyntaxError: invalid syntax
Havent taken a look at it yet, but it looks like you are missing a bunch of variables. What is "even"? Is that all of your source code?
it didn't give me space to write the else code. It stopped at that level.
write your code on a text document and attach it :)
It is invalid syntax because your "wording" did not make sense to python- This statement- [if (x/2)*2 ==x:] is fine, but [if (x/2)*2 =x:] is not because "=" assigns a value and does not "equate"
ok but why the result was 15 an even number ?
because 15/2 = 7.5 and 7.5*2 = 15
not the best way to test for even/odd number. On the other hand "%" works really well (which you did )
yes...Thanks a lot. Not used yet to " " and ( ) and this is giving me hard times but its fun. Thanks a lot again for helping me.
You are welcome :) I apologize for the improper use of tokens ( " ", [ ] ), but I am glad I was able to help.