Vidyalelo
Python · Q25

Decorators in Depth

Programming · Python · question 25

Q25

What is the purpose of the @dataclass decorator in Python?

A.
To create data visualization
B.
To add metadata to classes
C.
To create a class for data manipulation
D.
To simplify the creation of classes for storing data
Answer

Answer: Option D

Solution

Answer: Option D
Solution:
The @dataclass decorator simplifies the creation of classes for storing and manipulating data.