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):
11/20/2023 at 03:30AM
02/25/2021 at 06:33PM
03/10/2021 at 08:01PM
03/11/2021 at 07:54AM
03/12/2021 at 03:01PM
03/15/2021 at 05:04PM
03/30/2021 at 03:01PM
04/05/2021 at 01:34PM
05/09/2021 at 03:52PM
07/13/2021 at 08:13PM
08/08/2021 at 10:07AM
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
04/04/2023 at 12:38PM
04/07/2023 at 07:27AM
04/08/2023 at 03:50PM
04/14/2023 at 07:16AM
07/20/2023 at 01:12PM
09/24/2023 at 03:30AM
02/17/2021 at 01:36AM