3 ms·
It seems more likely that it learned it. If you knew nothing about Python, but understood the word "for" a little, and understood code a little, you're likely t
by etskinner 5y ago
It seems more likely that it learned it. If you knew nothing about Python, but understood the word "for" a little, and understood code a little, you're likely to figure out that range() is zero-indexed after you see something like this a few times
>>> for i in range(3):
print(i)
0
1
2
- lopatin 5y agoMy mind is just blown that it learned a language runtime based on examples. What would happen if you gave it an infinitely recusrive function? It can't stack overflow, there's no stack! Wait, is there?
- stevenhuang 5y agoMy guess is it would respond with the standard stack overflow error, from examples of similar output posted in its training set.
- deleted 5y ago[deleted]
- YeGoblynQueenne 5y agoIt hasn't. It's memorised the examples and can generate them with some variation and according to what output is more likely given the input. But that's generation, not computation. I don't know if this example helps, but a computer can generate (pseudo-)random numbers by executing an algorithm. A pair of dice can also generate random numbers because they're thrown so that they land at random and someone has marked pips on their faces that a human can read as numbers. The result may be similar, but one is generated by a computation and the other by a random process. The random process is not a computation. It's a random process. (Or just unpredictable).