Real Vim ninjas count every keystroke - do you?

Pick a challenge, fire up Vim, and show us what you got.

Changelog, Rules & FAQ, updates: @vimgolf, RSS.

Your VimGolf key: please sign in

$ gem install vimgolf
$ vimgolf setup
$ vimgolf put 9v00628a9b2f000000000220

Poorly indented Python comments

Fix the alignment of some Python comments as quickly as possible.

Start file
      # Working with enumerations in Python #

from enum import Enum

class Shake(Enum):
    VANILLA = 7
    CHOCOLATE = 4
    COOKIES = 9
    MINT = 3

print(type(Shake.MINT))   #   <enum 'Shake'> 

print(Shake.CHOCOLATE.name)               #    CHOCOLATE
print(Shake.CHOCOLATE.value)                   #     4

print(repr(Shake['COOKIES']))              #  <Shake.COOKIES: 9>

Animal = Enum('Animal', 'ANT BEE CAT DOG')

A = list(Animal); print(A)
# [<Animal.ANT: 1>, <Animal.BEE: 2>, <Animal.CAT: 3>, <Animal.DOG: 4>]
End file
      # Working with enumerations in Python #

from enum import Enum

class Shake(Enum):
    VANILLA = 7
    CHOCOLATE = 4
    COOKIES = 9
    MINT = 3

print(type(Shake.MINT))         # <enum 'Shake'> 

print(Shake.CHOCOLATE.name)     # CHOCOLATE
print(Shake.CHOCOLATE.value)    # 4

print(repr(Shake['COOKIES']))   # <Shake.COOKIES: 9>

Animal = Enum('Animal', 'ANT BEE CAT DOG')

A = list(Animal); print(A)
# [<Animal.ANT: 1>, <Animal.BEE: 2>, <Animal.CAT: 3>, <Animal.DOG: 4>]

View Diff

11c11
< print(type(Shake.MINT))   #   <enum 'Shake'> 
---
> print(type(Shake.MINT))         # <enum 'Shake'> 
13,14c13,14
< print(Shake.CHOCOLATE.name)               #    CHOCOLATE
< print(Shake.CHOCOLATE.value)                   #     4
---
> print(Shake.CHOCOLATE.name)     # CHOCOLATE
> print(Shake.CHOCOLATE.value)    # 4
16c16
< print(repr(Shake['COOKIES']))              #  <Shake.COOKIES: 9>
---
> print(repr(Shake['COOKIES']))   # <Shake.COOKIES: 9>

Solutions by @frankevislav:

Unlock 26 remaining solutions by signing in and submitting your own entry
Created by: @JeanGeo20504212

221 active golfers, 1315 entries

Solutions by @frankevislav:
15
#13 - Frankevislav / @frankevislav

06/14/2022 at 01:49AM

15
#>14 - Frankevislav / @frankevislav

06/16/2022 at 02:55AM

17
#>63 - Frankevislav / @frankevislav

06/16/2022 at 02:52AM

21
#>69 - Frankevislav / @frankevislav

06/14/2022 at 01:37AM

22
#>78 - Frankevislav / @frankevislav

06/13/2022 at 02:54AM

22
#>79 - Frankevislav / @frankevislav

06/16/2022 at 02:47AM

23
#>86 - Frankevislav / @frankevislav

06/13/2022 at 12:43AM

24
#>88 - Frankevislav / @frankevislav

06/13/2022 at 02:47AM

25
#>97 - Frankevislav / @frankevislav

06/12/2022 at 10:55PM

29
#>108 - Frankevislav / @frankevislav

06/12/2022 at 10:48PM

29
#>108 - Frankevislav / @frankevislav

06/13/2022 at 01:41AM

30
#>117 - Frankevislav / @frankevislav

06/12/2022 at 10:45PM

33
#>125 - Frankevislav / @frankevislav

06/12/2022 at 10:35PM

37
#>140 - Frankevislav / @frankevislav

06/12/2022 at 10:25PM

37
#>140 - Frankevislav / @frankevislav

06/12/2022 at 10:31PM

40
#>146 - Frankevislav / @frankevislav

06/12/2022 at 09:27PM

43
#>154 - Frankevislav / @frankevislav

06/12/2022 at 09:21PM

43
#>154 - Frankevislav / @frankevislav

06/12/2022 at 09:41PM

44
#>159 - Frankevislav / @frankevislav

06/13/2022 at 01:20AM

49
#>165 - Frankevislav / @frankevislav

06/10/2022 at 02:15PM

53
#>169 - Frankevislav / @frankevislav

06/10/2022 at 02:06PM

54
#>171 - Frankevislav / @frankevislav

06/12/2022 at 10:08PM

74
#>193 - Frankevislav / @frankevislav

06/10/2022 at 02:00PM

74
#>193 - Frankevislav / @frankevislav

06/11/2022 at 08:23PM

120
#>211 - Frankevislav / @frankevislav

06/10/2022 at 01:52PM

123
#>211 - Frankevislav / @frankevislav

06/10/2022 at 01:58PM