Examveda

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: Option D

Solution (By Examveda Team)

The @dataclass decorator simplifies the creation of classes for storing and manipulating data.

This Question Belongs to Python Program >> Decorators In Depth

Join The Discussion

Related Questions on Decorators in Depth