Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
from dataclasses import dataclass, field @dataclass class Point: x: float y: float label: str = "origin" p = Point(1.0, 2.0) print(p) # Point(x=1.0, y=2.0, label="origin") print(p == Point(1.0, 2.0)) # True
Result
Open