Why can't I define a variable like "miles_driven" with an underscore in Python 3.4.3 ?

Steven D'Aprano steve+python at pearwood.info
Wed Aug 10 22:14:19 EDT 2016


On Thu, 11 Aug 2016 06:57 am, Cai Gengyang wrote:

> Yea, using IDLE on OSX, Python 3.4.3.
> 
> Yeah it works now ... I had to increase the font size and the indentation
> width. When that happened , it could define miles_driven

You were always defining "miles_driven", it is just that the display engine
used by IDLE on OS X wasn't capable of displaying the underscore using the
combination of typeface (font), size and line height.

My guess is that you had it set to a very small size and the underscore just
wasn't visible.



-- 
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
enough, things got worse.




More information about the Python-list mailing list