Created
November 18, 2022 17:15
-
-
Save petrosDemetrakopoulos/cda19325e3acbb59fc997d5d7ce63e21 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dataclasses import dataclass | |
@dataclass | |
class User: | |
email: str | |
name: str = "First name" | |
surname: str = "Last name" | |
def fullName(self): | |
return self.name + " " + self.surname | |
user_instance = User('[email protected]','Petros', 'Demetrakopoulos',) | |
print(user_instance) | |
print(user_instance.fullName()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment