Re: [Tutor] How to access an instance variable of a superclass from an instance of the subclass?

2017-02-22 Thread Alex Kleider
On 2017-02-22 20:53, boB Stepp wrote: On Wed, Feb 22, 2017 at 10:25 PM, boB Stepp wrote: I am trying to wrap my head around the mechanics of inheritance in Python 3. I thought that all attributes of a superclass were accessible to an instance of a subclass. But when I try the following: py3:

Re: [Tutor] How to access an instance variable of a superclass from an instance of the subclass?

2017-02-22 Thread boB Stepp
On Wed, Feb 22, 2017 at 10:25 PM, boB Stepp wrote: > I am trying to wrap my head around the mechanics of inheritance in > Python 3. I thought that all attributes of a superclass were > accessible to an instance of a subclass. But when I try the > following: > > py3: class A: > ... def __init

Re: [Tutor] How to access an instance variable of a superclass from an instance of the subclass?

2017-02-22 Thread Zachary Ware
On Wed, Feb 22, 2017 at 10:25 PM, boB Stepp wrote: > I am trying to wrap my head around the mechanics of inheritance in > Python 3. I thought that all attributes of a superclass were > accessible to an instance of a subclass. > > Obviously I am horribly misunderstanding something, and being > cur

[Tutor] How to access an instance variable of a superclass from an instance of the subclass?

2017-02-22 Thread boB Stepp
I am trying to wrap my head around the mechanics of inheritance in Python 3. I thought that all attributes of a superclass were accessible to an instance of a subclass. But when I try the following: py3: class A: ... def __init__(self): ... self.aa = 'class A' ... py3: class B(A)

Re: [Tutor] Trip Advisor Web Scraping

2017-02-22 Thread Alan Gauld via Tutor
On 22/02/17 02:55, Francis Pino wrote: > I need to recode my hotel ratings as 1-3 = Negative and 4-5 Positive. Can > you help point me in the direction to do this? I know I need to make a loop > using for and in and may statement like for rating in review if review >= 3 > print ('Negative') else

[Tutor] Trip Advisor Web Scraping

2017-02-22 Thread Francis Pino
I need to recode my hotel ratings as 1-3 = Negative and 4-5 Positive. Can you help point me in the direction to do this? I know I need to make a loop using for and in and may statement like for rating in review if review >= 3 print ('Negative') else print 'Negative'. Here's my code so far. fr