Code:
z = z =1;
You meant:
Code:
z = z + 1
Code:
z++;
There's no reason NOT to have the preincrement and postdecrement in the if condition, it is just a bit obtuse. In the if and else, in the print statements, you may want to print y+1 instead of y, since that will be the value when the if is evaluated. That would make more sense to me, at least. This is changing the behavior of the original code, but the behavior of the original was silly, IMO.
-Lee