repl.it
@acwoss/

sopt-question-395183

Python

https://pt.stackoverflow.com/q/395183/5878

fork
loading
Files
  • main.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from dataclasses import dataclass

@dataclass
class Character:
    name: str
    genre: str
    race: str

    def __str__(self):
        return (
            'Dados do personagem:\n'
            f'Nome: {self.name}\n'
            f'Gênero: {self.genre}\n'
            f'Raça: {self.race}\n'
        )

woss = Character(name='Woss', genre='male', race='god')

print(woss)
Fetching token
?