Shell -- Python returns "..." when a loop is present

A Xojo shell to run a loop in Python3 (MacOS) to then get a multiline string out of a loop.
When the script includes a loop (even if I don’t print the result of the loop) I just get : … (Three dots) returned.
This seems to be normal behaviour also in the MacOS terminal (as a way of warning?), by pressing Return again the data is presented.
Can I access the series of numbers (that I can get in the Terminal by again pressing return)?

shell1.mode=2
shell1.Execute “/Users/roger/opt/anaconda3/bin/python3.7”

shell1.Writeline “for y in range(0, 10):”
shell1.Writeline " print(y)"

Shell1.ReadAll

Result: …


Just a sidenote:
I have tried to solve it by making an array, but what works in Jypiter, Coderunner etc fails in the Terminal:
x=[]
for y in range(0, 10):
x.append(y)
print(x)

I solved it by saving the script into a file.
Shell.execute “path-to-Python path-to-file”