Is there a difference between the following and if there is when should i use one over the other? Thanks.
1.
class person: name: str = 'alice'
2.
class person: def __init__(self, name): self.name = 'alice'
submitted by /u/ItsBlueSkyz
[link] [comments]
r/learnpython Is there a difference between the following and if there is when should i use one over the other? Thanks. 1. class person: name: str = ‘alice’ 2. class person: def __init__(self, name): self.name = ‘alice’ submitted by /u/ItsBlueSkyz [link] [comments]
Is there a difference between the following and if there is when should i use one over the other? Thanks.
1.
class person: name: str = 'alice'
2.
class person: def __init__(self, name): self.name = 'alice'
submitted by /u/ItsBlueSkyz
[link] [comments]