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 4d42cde1e6dc010cb7000024

expand a list comprehension (python)

Please show your way to convert a list comprehension in python to an ordinary for-loop expression!

Start file
print [x**2 for x in xrange(10)]
End file
tmp = []
for x in xrange(10):
    tmp.append(x**2)
print tmp

View Diff

1c1,4
< print [x**2 for x in xrange(10)]
---
> tmp = []
> for x in xrange(10):
>     tmp.append(x**2)
> print tmp

Solutions by @MingDai2:

Unlock 14 remaining solutions by signing in and submitting your own entry
Created by: @vimgolfer

106 active golfers, 301 entries

Solutions by @MingDai2:
42
#15 - Ming Dai / @MingDai2

07/07/2020 at 09:13PM

43
#>23 - Ming Dai / @MingDai2

07/07/2020 at 09:12PM

44
#>26 - Ming Dai / @MingDai2

07/07/2020 at 09:11PM

44
#>26 - Ming Dai / @MingDai2

07/07/2020 at 09:16PM

45
#>27 - Ming Dai / @MingDai2

07/07/2020 at 09:07PM

46
#>28 - Ming Dai / @MingDai2

07/07/2020 at 09:03PM

47
#>32 - Ming Dai / @MingDai2

07/07/2020 at 09:02PM

48
#>35 - Ming Dai / @MingDai2

07/07/2020 at 08:53PM

49
#>37 - Ming Dai / @MingDai2

07/07/2020 at 08:49PM

50
#>40 - Ming Dai / @MingDai2

07/07/2020 at 08:58PM

52
#>49 - Ming Dai / @MingDai2

07/07/2020 at 08:43PM

55
#>61 - Ming Dai / @MingDai2

07/07/2020 at 08:57PM

56
#>66 - Ming Dai / @MingDai2

07/07/2020 at 08:45PM

64
#>86 - Ming Dai / @MingDai2

07/07/2020 at 08:47PM