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

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

46 active golfers, 172 entries

Solutions by @martinodelilo:
31
#6 - Martin Delille / @martinodelilo

08/30/2019 at 05:56PM

33
#>14 - Martin Delille / @martinodelilo

08/30/2019 at 05:55PM

34
#>18 - Martin Delille / @martinodelilo

08/30/2019 at 05:54PM

35
#>20 - Martin Delille / @martinodelilo

08/30/2019 at 05:53PM

40
#>22 - Martin Delille / @martinodelilo

08/30/2019 at 05:52PM

41
#>23 - Martin Delille / @martinodelilo

08/30/2019 at 05:50PM

48
#>24 - Martin Delille / @martinodelilo

08/30/2019 at 05:47PM

50
#>26 - Martin Delille / @martinodelilo

08/30/2019 at 05:45PM

51
#>28 - Martin Delille / @martinodelilo

08/30/2019 at 05:43PM

52
#>29 - Martin Delille / @martinodelilo

08/30/2019 at 05:42PM

53
#>31 - Martin Delille / @martinodelilo

08/30/2019 at 05:39PM

54
#>34 - Martin Delille / @martinodelilo

08/30/2019 at 05:35PM

56
#>34 - Martin Delille / @martinodelilo

08/30/2019 at 05:31PM

59
#>38 - Martin Delille / @martinodelilo

08/30/2019 at 05:10PM

69
#>41 - Martin Delille / @martinodelilo

08/30/2019 at 05:02PM