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

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

122 active golfers, 649 entries

Solutions by @orangutanganga:
15
#22 - Name can't be blank. / @orangutanganga

08/18/2022 at 01:27PM

15
#>22 - Name can't be blank. / @orangutanganga

08/18/2022 at 01:27PM

21
#>34 - Name can't be blank. / @orangutanganga

08/18/2022 at 01:25PM

22
#>40 - Name can't be blank. / @orangutanganga

08/18/2022 at 01:14PM

23
#>45 - Name can't be blank. / @orangutanganga

08/18/2022 at 12:37PM

25
#>53 - Name can't be blank. / @orangutanganga

08/18/2022 at 11:57AM

26
#>54 - Name can't be blank. / @orangutanganga

08/18/2022 at 11:54AM

28
#>56 - Name can't be blank. / @orangutanganga

08/18/2022 at 11:49AM

29
#>61 - Name can't be blank. / @orangutanganga

08/18/2022 at 09:42AM

29
#>61 - Name can't be blank. / @orangutanganga

08/18/2022 at 11:47AM

30
#>67 - Name can't be blank. / @orangutanganga

08/18/2022 at 09:40AM

31
#>67 - Name can't be blank. / @orangutanganga

08/18/2022 at 09:39AM

34
#>72 - Name can't be blank. / @orangutanganga

08/18/2022 at 09:37AM

36
#>76 - Name can't be blank. / @orangutanganga

08/18/2022 at 09:35AM

39
#>83 - Name can't be blank. / @orangutanganga

08/18/2022 at 09:21AM