Me: "Why do you want to learn to code?"
Them: "Because I want to build X, or I want to modify Y, or I'd like to learn how to do Z but it seems like I need to know how to code first." (This is the ideal answer but in reality it's usually not the one I get. "Uh, I donno... because it looks cool or fun or I can get a really good job," is the more common answer.)
If someone doesn't know why they want to learn something, they will be more likely to give up as soon as the learning gets tough.
By the time I was 12 I had spent 4 or 5 years playing with computers, taking them apart, building them, and spending lots of time playing games.
One day I asked my dad, "how do they make those games on the computer that I've been playing for the past few years?" I wanted to know how so that I could tinker and build my own games too. My dad was a technical writer at the time and the only programming language he knew of was a language called BASIC (this was the early 1990s) and suggested that I pick up a book the next time we were at the book store. (That led me from QBASIC -> Visual Basic -> PHP, of which I'm currently most proficient. I wish he had told me "C" or "C++"; my life would've taken a much different route.)
When I started digging into Python a few years ago, it was because I wanted to build a script that connected two APIs and manipulated some XML. I knew through the grapevine that Python was a good language for that, so I dug in. It got tough, but I had a goal in mind. There was something tangible that I was working towards, a light at the end of the tunnel that I could keep aiming for no matter how long it took me.
I cannot understate the importance of knowing why you're doing something, especially when you're learning a new skill. (I think this applies more to adults than to children.)