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

2016-08-10 Thread Steven D'Aprano
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

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

2016-08-10 Thread Ethan Furman
On 08/10/2016 01:57 PM, 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 I suspect you were defining it before, you just couldn't see the underscore. --

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

2016-08-10 Thread Cai Gengyang
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 On Thursday, August 11, 2016 at 2:09:11 AM UTC+8, Zachary Ware wrote: > On Wed, Aug 10, 2016 at 12:39 PM, Cai Gengyang wr

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

2016-08-10 Thread Zachary Ware
On Wed, Aug 10, 2016 at 12:39 PM, Cai Gengyang wrote: > I managed to get this piece of code to work : > print("This program calculates mpg.") > This program calculates mpg. milesdriven = input("Enter miles driven:") > Enter miles driven: 50 milesdriven = float(milesdriven) gall

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

2016-08-10 Thread Michael Selik
On Wed, Aug 10, 2016 at 1:41 PM Cai Gengyang wrote: > I managed to get this piece of code to work : > > >>> print("This program calculates mpg.") > This program calculates mpg. > >>> milesdriven = input("Enter miles driven:") > Enter miles driven: 50 > >>> milesdriven = float(milesdriven) > >>> g

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

2016-08-10 Thread Cai Gengyang
I managed to get this piece of code to work : >>> print("This program calculates mpg.") This program calculates mpg. >>> milesdriven = input("Enter miles driven:") Enter miles driven: 50 >>> milesdriven = float(milesdriven) >>> gallonsused = input("Enter gallons used:") Enter gallons used: 100 >>>