ChatGPT, Python and Misplaced Confidence
I had an amazing encounter with the ChatGPT AI today. Someone on the Halihax slack who was working on today’s Advent of Code challenge was bemoaning the absence of a way to tell a Python list comprehension to stop after the first N iterations. That didn’t seem completely unreasonable, but I didn’t know how to do it, so I thought I’d find out if ChatGPT knew how. For those unfamiliar with list comprehensions: in Python there is a convenient syntax for working with lists, so that instead of writing something like ...