Download Python/train/3.12/pattern-matching/modern_17.py from SwashBuckler001/idiombench: direct link, hf CLI and curl.
- Browser
- Download file 259 Bytes
-
https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.12/pattern-matching/modern_17.py
- Command line
-
hf download hf://datasets/SwashBuckler001/idiombench/Python/train/3.12/pattern-matching/modern_17.py
-
curl -L -o modern_17.py https://huggingface.co/datasets/SwashBuckler001/idiombench/resolve/main/Python/train/3.12/pattern-matching/modern_17.py
259 Bytes
| from enum import Enum | |
| class Color(Enum): | |
| RED = 0 | |
| GREEN = 1 | |
| BLUE = 2 | |
| match color: | |
| case Color.RED: | |
| print("I see red!") | |
| case Color.GREEN: | |
| print("Grass is green") | |
| case Color.BLUE: | |
| print("I'm feeling the blues :(") | |