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

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

221 active golfers, 1315 entries

Solutions by @kse8425z:
43
#158 - 야호 / @kse8425z

10/01/2023 at 09:50PM

45
#>160 - 야호 / @kse8425z

10/01/2023 at 09:32PM

51
#>168 - 야호 / @kse8425z

10/01/2023 at 09:21PM

54
#>173 - 야호 / @kse8425z

10/01/2023 at 09:05PM

56
#>173 - 야호 / @kse8425z

10/01/2023 at 09:03PM

61
#>183 - 야호 / @kse8425z

10/01/2023 at 08:53PM

69
#>189 - 야호 / @kse8425z

10/01/2023 at 08:44AM

75
#>193 - 야호 / @kse8425z

01/28/2023 at 11:51PM

89
#>200 - 야호 / @kse8425z

10/01/2023 at 08:37AM

97
#>205 - 야호 / @kse8425z

01/28/2023 at 11:57PM

138
#>214 - 야호 / @kse8425z

01/28/2023 at 11:43PM