I'm trying to follow this easy Python exercise but I can't achieve it in a Python shell and would like an explanation why. Below is the solution to a Python question which you can put in a compiler, but if I wanted to enter these in a shell, why doesn't adding a back slash allow me to continue writing lines? I get invalid syntax trying to write the following. Of course, I can't even make it beyond the second line without a syntax error. My shell is Python 3.8.9.
import datetime \
now = datetime.datetime.now() \
print ("Current date and time : ") \
print (now.strftime("%Y-%m-%d %H:%M:%S"))