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"
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
228 remaining solutions by
signing in and submitting your own entry
#229
Kenneth Hyman / @kjhyman -
Score: 107 -
04/27/21 @ 14:12
jjjjebveyjjjjejekeeei<Esc>pkkkkbbbveduveyjjjeeeeebea,<Esc>pkkkbbbveduveyjjjeeeeeea,<Esc>p<Esc>kkbbbveyjjeeeeeeeea,<Esc>p:w<CR>:wq<CR>
0 comments
229 active golfers, 881 entries
Leaderboard (lowest score wins):
01/29/2021 at 02:12PM
01/29/2021 at 04:58PM
01/29/2021 at 10:32PM
02/01/2021 at 12:07AM
02/01/2021 at 09:47PM
02/03/2021 at 06:41AM
03/06/2021 at 01:06AM
03/08/2021 at 09:15PM
03/13/2021 at 02:26AM
03/19/2021 at 10:06AM
03/19/2021 at 01:10PM
03/20/2021 at 09:00PM
03/22/2021 at 08:04PM
03/22/2021 at 10:55PM
03/23/2021 at 04:10PM
04/05/2021 at 12:49AM
04/28/2021 at 09:45PM
05/05/2021 at 12:09AM
05/16/2021 at 03:18AM
05/18/2021 at 08:42AM
05/20/2021 at 02:34PM
05/30/2021 at 12:30AM
05/30/2021 at 02:27PM
06/05/2021 at 05:17PM
06/20/2021 at 12:27AM
06/22/2021 at 01:22PM
06/27/2021 at 05:36PM
07/02/2021 at 11:29PM
07/04/2021 at 08:34AM
07/13/2021 at 09:05AM