简体   繁体   中英

Class 'x' has no 'y' member

I've been trying to use variables of another method, that belongs to the same class, for compare it.

My code looks like this:

def __init__ (self, Title, Complexity, Time):
    self.Title = Title                       
    self.Complexity = Complexity
    self.Time = Time 

def organizatingTime(self):
    if Activitie.Complexity() > 6:
        time = Activitie.Time()

but VS shows me

Class 'Activitie' has no 'Time' member
Class 'Activitie' has no 'Complexity' member

Anything that works is good.

Try

   def __init__ (self, Title, Complexity, Time):
        self.Title = Title                       
        self.Complexity = Complexity
        self.Time = Time 

    def organizatingTime(self):
        if self.Complexity() > 6:
            time = self.Time()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM