Chris Angelico writes: > Here's a side challenge. In any shell you like, start with this > failing statement, and then fix it without retyping anything: > > sikorsky@sikorsky:~$ python -c "a=1; if a: print(a)" > File "<string>", line 1 > a=1; if a: print(a) > ^ > SyntaxError: invalid syntax > > In bash, I was unable to insert a newline into the quoted string. My > only option was to backspace everything after the point where I > wanted the newline, then hit enter, then retype the if. I'm curious > to know if that's simply because I didn't think of (some bash > feature), or alternatively, if there's another shell that would have > made this easy.
C-v C-j inserts a newline for me, in bash. -- http://mail.python.org/mailman/listinfo/python-list