Extra tabs in iPython

I have this code in a .py file on Replit. When I copy it into iPython running in Shell, an extra tab is introduced and I get an indentation error. If I take the same code and put it in Google Colab I don’t get the error. Any ideas? It’s impossible to teach students conditional flow when extra indentation is added randomly.

from datetime import datetime as dt
if dt.now().hour < 12:
	print("Good morning")
else:
	print("Good afternoon")

Sounds like a bug with iPython, not Replit. I’m curious why you’re needing to use something other than Replit to run this code?

I would agree that it’s iPython except I used this exact same file with the same versions of Python, iPython, etc. last fall and didn’t have the issue. It’s possible something changed here, but I can’t figure out what it would be on my end.

We do more than just this bit of code. Basically I want them through little chunks of code which we copy and paste into iPython. Running the file completely does work (except for the iPython magics), but it’s not really the intent of this part of the course.

Sorry, should have mentioned that iPython is running on Replit. It’s just running in the Shell tab rather than the Console tab in Replit.