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 @puthipiroj:

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

221 active golfers, 1315 entries

Solutions by @puthipiroj:
15
#15 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:28PM

21
#>71 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:25PM

22
#>80 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:23PM

23
#>87 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:21PM

24
#>88 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:23PM

25
#>99 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:17PM

28
#>106 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:14PM

29
#>109 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:10PM

30
#>117 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:10PM

32
#>122 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:07PM

34
#>127 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:05PM

49
#>165 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:03PM

61
#>183 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 04:00PM

63
#>184 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 03:59PM

67
#>187 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 03:53PM

67
#>187 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 03:55PM

80
#>196 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 03:57PM

94
#>201 - Jacob Puthipiroj / @puthipiroj

06/22/2022 at 03:51PM