Python dataclasses
Simple challenge to extract fields from a Python class
Start file
from dataclasses import dataclass
@dataclass
class Student:
student_id: str
name: str
age: int
score: float
fields = ""
End file
from dataclasses import dataclass
@dataclass
class Student:
student_id: str
name: str
age: int
score: float
fields = "student_id,name,age,score"
View Diff
10c10
< fields = ""
---
> fields = "student_id,name,age,score"
Solutions
The best way to learn is to practice. Below, you will find some of the solutions other golfers have entered. To unlock higher ranked solutions, submit your own entry which does as well or better than the solutions you can currently see - climb the ladder!
Check out these helpful resources to improve your Vim skills... Game on.
Unlock 293 remaining solutions by signing in and submitting your own entry
#294 Meshan Naidoo / @realmeshan - Score: 227 - 01/14/24 @ 15:03
<Esc>jkjjjjwlyawjjjjjaa<Esc>uuujkkkkkkywa<Esc><Esc>jkyawjjjjjwwlhpa,<Esc>jkkkkkbhhhyawjjjjwwlllllllllllp<Esc>jkkkkkkjjbbhyawjjj4$<Esc>jkkjha,vimgolf put 6013804df3308e0009368f1c<Esc><Esc>ua<Esc>ha,<Esc>jkkkb<Esc>kbbjkhyawjjjwwwlllllllllllllllp<Esc>jkkkkjhhhhhhhhyawjj$<Esc>ha,<Esc>p<Esc>:wq<CR>
0 comments