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 5c26476de8c6490009fcad3e

Python challenge

Change the types of the variables in the list from str to float, while keeping the truncation.

Start file
a = ['%.3f' % 3.5313423, '%.1f' % 35.66]
b = ['%.3f' % 3.90022, '%.1f' % 95.501033]
c = ['%.5f' % self.numbers[2]]
End file
a = [round(3.5313423, 3), round(35.66, 1)]
b = [round(3.90022, 3), round(95.501033, 1)]
c = [round(self.numbers[2], 5)]

View Diff

1,3c1,3
< a = ['%.3f' % 3.5313423, '%.1f' % 35.66]
< b = ['%.3f' % 3.90022, '%.1f' % 95.501033]
< c = ['%.5f' % self.numbers[2]]
---
> a = [round(3.5313423, 3), round(35.66, 1)]
> b = [round(3.90022, 3), round(95.501033, 1)]
> c = [round(self.numbers[2], 5)]

Solutions by @nickandbro:

Unlock 24 remaining solutions by signing in and submitting your own entry
Created by: @rax0m

46 active golfers, 172 entries

Solutions by @nickandbro:
31
#11 - nickGPT / @nickandbro

08/25/2024 at 02:51AM

32
#>13 - nickGPT / @nickandbro

08/25/2024 at 02:51AM

33
#>16 - nickGPT / @nickandbro

08/25/2024 at 02:51AM

34
#>18 - nickGPT / @nickandbro

08/25/2024 at 02:51AM

35
#>20 - nickGPT / @nickandbro

08/25/2024 at 02:51AM

38
#>21 - nickGPT / @nickandbro

08/25/2024 at 02:51AM

40
#>22 - nickGPT / @nickandbro

08/25/2024 at 02:51AM

41
#>23 - nickGPT / @nickandbro

08/25/2024 at 02:51AM

48
#>24 - nickGPT / @nickandbro

08/25/2024 at 02:50AM

50
#>27 - nickGPT / @nickandbro

08/25/2024 at 02:50AM

51
#>28 - nickGPT / @nickandbro

08/25/2024 at 02:50AM

52
#>29 - nickGPT / @nickandbro

08/25/2024 at 02:50AM

53
#>31 - nickGPT / @nickandbro

08/25/2024 at 02:50AM

54
#>34 - nickGPT / @nickandbro

08/25/2024 at 02:50AM

58
#>36 - nickGPT / @nickandbro

08/25/2024 at 02:50AM

59
#>38 - nickGPT / @nickandbro

08/25/2024 at 02:50AM

62
#>39 - nickGPT / @nickandbro

08/25/2024 at 02:50AM

63
#>40 - nickGPT / @nickandbro

08/25/2024 at 02:50AM

64
#>41 - nickGPT / @nickandbro

08/25/2024 at 02:50AM

66
#>41 - nickGPT / @nickandbro

08/25/2024 at 02:50AM

87
#>43 - nickGPT / @nickandbro

08/25/2024 at 02:49AM

107
#>44 - nickGPT / @nickandbro

08/25/2024 at 02:49AM

126
#>45 - nickGPT / @nickandbro

08/25/2024 at 02:49AM

137
#>45 - nickGPT / @nickandbro

08/25/2024 at 02:49AM