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

143 active golfers, 748 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
#>29 - Frankevislav / @frankevislav

06/16/2022 at 02:52AM

21
#>36 - Frankevislav / @frankevislav

06/14/2022 at 01:37AM

22
#>45 - Frankevislav / @frankevislav

06/13/2022 at 02:54AM

22
#>46 - Frankevislav / @frankevislav

06/16/2022 at 02:47AM

23
#>52 - Frankevislav / @frankevislav

06/13/2022 at 12:43AM

24
#>53 - Frankevislav / @frankevislav

06/13/2022 at 02:47AM

25
#>60 - Frankevislav / @frankevislav

06/12/2022 at 10:55PM

29
#>67 - Frankevislav / @frankevislav

06/12/2022 at 10:48PM

29
#>67 - Frankevislav / @frankevislav

06/13/2022 at 01:41AM

30
#>76 - Frankevislav / @frankevislav

06/12/2022 at 10:45PM

33
#>82 - Frankevislav / @frankevislav

06/12/2022 at 10:35PM

37
#>93 - Frankevislav / @frankevislav

06/12/2022 at 10:25PM

37
#>93 - Frankevislav / @frankevislav

06/12/2022 at 10:31PM

40
#>97 - Frankevislav / @frankevislav

06/12/2022 at 09:27PM

43
#>102 - Frankevislav / @frankevislav

06/12/2022 at 09:21PM

43
#>102 - Frankevislav / @frankevislav

06/12/2022 at 09:41PM

44
#>104 - Frankevislav / @frankevislav

06/13/2022 at 01:20AM

49
#>106 - Frankevislav / @frankevislav

06/10/2022 at 02:15PM

53
#>108 - Frankevislav / @frankevislav

06/10/2022 at 02:06PM

54
#>110 - Frankevislav / @frankevislav

06/12/2022 at 10:08PM

74
#>121 - Frankevislav / @frankevislav

06/10/2022 at 02:00PM

74
#>121 - Frankevislav / @frankevislav

06/11/2022 at 08:23PM

120
#>134 - Frankevislav / @frankevislav

06/10/2022 at 01:52PM

123
#>134 - Frankevislav / @frankevislav

06/10/2022 at 01:58PM