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

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

221 active golfers, 1315 entries

Solutions by @lwgZVRoOQ8Nf6VG:
16
#58 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 05:02PM

17
#>64 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 05:01PM

17
#>64 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 05:03PM

21
#>74 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:59PM

22
#>82 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:57PM

23
#>87 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:55PM

24
#>90 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:51PM

25
#>101 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:50PM

26
#>102 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:49PM

27
#>105 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:28PM

28
#>106 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:12PM

29
#>114 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:11PM

30
#>119 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:10PM

31
#>121 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:11PM

34
#>129 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:09PM

36
#>137 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:02PM

45
#>160 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 04:07PM

61
#>183 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 05:02PM

69
#>189 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 03:58PM

165
#>218 - わーお / @lwgZVRoOQ8Nf6VG

06/04/2023 at 03:53PM