0

Python Class code help

Hi, here follows my personalized script from a tutorial: class people: def __init__(self,name,color,sport): self.name=name self.color=color self.sport=sport def personalfolder(self): folder = "Name: {}\nColor: {}\nSport: {}".format(self.name,self.color,self.sport) return folder class genius(people): profile="genius" def __init__(self,name,color,sport,iq): super().__init__(self,name,color,sport) self.iq=iq def personalfolder(self): folder="Profile: {}\niq: {}".format(genius.profile,self.iq) return super().personalfolder() + folder gen_1=genius("Sheldon","Red","3DChess","187") print(gen_1.personalfolder()) Despite I followed any steps, it returns an error due to a mismatch in the number of inputs (4 vs 5). I honestly did the very same steps as the tutorial but I really don't know how to fix it. For sake of completeness: while the tutorial was using the f""" spec

12th Jul 2019, 9:05 AM
polargnome
3 ответов
+ 1
Swim you're my hero!!!! It works!!! Now...I wonder why it worked for the original code....maybe Pycharm has a function that allows to ignore that "self"? Anyway, thanks again!
12th Jul 2019, 11:46 AM
polargnome