Python newbie here.
Code snippet:
???
I copied this straight out a text book.
If I remove the ", end=' '" from the print command at the end, it runs fine.
I have tried "end=''" - removing the space between the tics, still get syntax error.
I have tried using double quotes, still get syntax error
I tried help('with'), but there is no mention of the end statement.
Maybe 'end' has been deprecated?
Any help is appreciated.
Note: The code suite is properly indented in my code, but the 'thread editor' removes them when I submit??
Should have mentioned: I'm using Python 3.7, and the textbook was copyrighted 2017.
Code snippet:
>>> with open('todos.txt') as tasks: for chore in tasks: print(chore, end=' ')SyntaxError: invalid syntax
???
I copied this straight out a text book.
If I remove the ", end=' '" from the print command at the end, it runs fine.
I have tried "end=''" - removing the space between the tics, still get syntax error.
I have tried using double quotes, still get syntax error
I tried help('with'), but there is no mention of the end statement.
Maybe 'end' has been deprecated?
Any help is appreciated.
Note: The code suite is properly indented in my code, but the 'thread editor' removes them when I submit??
Should have mentioned: I'm using Python 3.7, and the textbook was copyrighted 2017.