Feb-02-2020, 01:17 PM
(This post was last modified: Feb-02-2020, 01:20 PM by sebastianvdn.)
Hello Python community,
At the moment i'm starting to learn Python and it is going well, but I'm a bit stuck figuring out why the def __init__ wont take a parameter with a single asterisk.
The one with two works fine, anybody that knows if this even can work or is there something wrong in my code?
Here is the code:
Thanks in regards
Mudo
At the moment i'm starting to learn Python and it is going well, but I'm a bit stuck figuring out why the def __init__ wont take a parameter with a single asterisk.
The one with two works fine, anybody that knows if this even can work or is there something wrong in my code?
Here is the code:
print("\nAnother class for users:") class User(): """Describing a user.""" def __init__(self, first_name, last_name, *languages, **information): self.fullname = first_name + " " + last_name self.languages = languages self.information = information
Thanks in regards
Mudo