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
191 remaining solutions by
signing in and submitting your own entry
#192
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
192 active golfers, 761 entries
Leaderboard (lowest score wins):
08/12/2021 at 05:19PM
08/22/2021 at 09:34AM
09/20/2021 at 11:14PM
11/19/2021 at 01:48PM
11/30/2021 at 11:23AM
12/05/2021 at 07:17AM
01/07/2022 at 11:01AM
01/21/2022 at 10:58PM
02/24/2022 at 11:04AM
10/07/2022 at 08:53AM
12/06/2022 at 10:32AM
12/06/2022 at 09:57PM
02/17/2021 at 01:36AM
05/21/2021 at 03:58PM
04/02/2022 at 09:12AM
04/06/2022 at 05:58PM
04/12/2022 at 02:32AM
07/19/2022 at 07:35PM
12/04/2021 at 04:15PM
03/03/2022 at 04:52AM
05/06/2022 at 02:51PM
06/06/2022 at 03:39PM
03/26/2021 at 07:46PM
04/18/2021 at 04:18AM
05/03/2021 at 02:49PM
05/21/2021 at 12:36AM
07/17/2021 at 06:09PM
08/01/2021 at 08:54PM
12/03/2021 at 04:53PM
02/01/2021 at 10:21AM