3 questions
#1 First Methodclass Triangle(object): def area(self, b, h): self.b = b self.h = h return b*h/2a = Triangle()a.area(4,8)I tried to write down the code above using the init method.#2 Try the second ...
I usually speak C language, and sometimes I don't understand Python because it's a habit.What do self and _init__ do in the functions below?Is there any reason why you have to write it down?I think it...
class stat: def __init__(self, line): self.genre = line[1] self.member = line[2] self.album = line[3] self.like = int(line[6]) self.stat = [] self.total = 0 def like_sub(self.line): a = stat(se...
© 2024 OneMinuteCode. All rights reserved.