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

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

109 active golfers, 333 entries

Solutions by @gumnos:
42
#3 - Tim Chase / @gumnos

01/29/2011 at 12:56AM

42
#>4 - Tim Chase / @gumnos

01/29/2011 at 07:46PM

43
#>20 - Tim Chase / @gumnos

01/29/2011 at 12:54AM

43
#>20 - Tim Chase / @gumnos

01/29/2011 at 12:55AM

44
#>26 - Tim Chase / @gumnos

01/28/2011 at 03:20PM

46
#>29 - Tim Chase / @gumnos

01/28/2011 at 03:17PM

50
#>39 - Tim Chase / @gumnos

01/28/2011 at 03:15PM