repl.it
@acwoss/

ExpertImportantAnimatronics

Python

No description

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
from dataclasses import dataclass, fields, MISSING

@dataclass
class Character:
    name: str
    genre: str
    race: str
    level: int = 0

character_info = {}
for field in fields(Character):
    if field.default == MISSING:
        value = input(f'{field.name}: ')
        character_info[field.name] = field.type(value)

character = Character(**character_info)

print(character)
Fetching token
?