In C, one can do
while( (i=a) != b ) { }
but in Python, it appears, one cannot.
while (i = sys.stdin.read(1)) != "\n":
generates
while (i = sys.stdin.read(1)) != "\n":
^
SyntaxError: invalid syntax
(the ^ should be on the =)
Is there a workaround?
Use break: