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):
07/16/2021 at 01:55AM
07/27/2021 at 06:55PM
08/21/2021 at 04:12PM
08/24/2021 at 05:39AM
08/24/2021 at 04:57PM
09/16/2021 at 01:00PM
#37 - Alessandro Cantini / @aecant
10/06/2021 at 05:09PM
11/17/2021 at 02:16PM
11/26/2021 at 04:05PM
12/04/2021 at 06:23PM
12/08/2021 at 07:00PM
12/23/2021 at 11:34PM
01/31/2022 at 08:19AM
02/05/2022 at 04:15AM
06/03/2022 at 11:04AM
07/11/2022 at 11:17PM
07/27/2022 at 09:33AM
09/19/2022 at 07:01PM
10/22/2022 at 05:54PM
03/12/2023 at 12:10PM
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