I can’t speak for the poster, but I learned that trick (and many others) to play a game while stuck in traffic. Namely, derive the prime factorization of the license plate number in front of you before you lose sight of it. (Usually a 5 digit number in my area.)
Sort of silly, but it passes the time.
I test numbers for divisibility by 7 in my head almost every time I do a daily KenKen puzzle. There's usually a four or five-digit number in there whose factors I don't know off the top of my head, so I'll give it a quick check for sevens just to get my bearings.
But a python notebook could definitely beat me in a race.
It's just the fact that 1, 10, 100, 1000, ... = 1, 3, 2, -1, -3, -2, ... (repeating) mod 7
Oh and if you are copy pasting into notebook, then x %7 == 0 probably is a reasonable substitute...