I tried that in Bard too. First time it replied 7 letters and no code. Second time it said 8 with code snippet,
d a v i d j l
3rd time, it said 8 again with code snippet, davidjl
and it counted out the letters e.g. "d = 1 letter"I asked it "Are you sure?" after the 3rd one, it corrected itself to say 7 letters + counting out.
It's not using Python. Code generation seem accidental and just part of its output.
https://i.imgur.com/pyyhW0n.png