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

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

106 active golfers, 301 entries

Solutions by @oysteinwalle:
47
#30 - Øystein Walle / @oysteinwalle

07/08/2011 at 08:15PM

53
#>53 - Øystein Walle / @oysteinwalle

07/08/2011 at 08:05PM

54
#>56 - Øystein Walle / @oysteinwalle

07/08/2011 at 08:02PM

56
#>63 - Øystein Walle / @oysteinwalle

07/08/2011 at 07:54PM

56
#>63 - Øystein Walle / @oysteinwalle

07/08/2011 at 08:01PM

58
#>72 - Øystein Walle / @oysteinwalle

07/08/2011 at 07:43PM

59
#>74 - Øystein Walle / @oysteinwalle

07/08/2011 at 07:42PM

60
#>77 - Øystein Walle / @oysteinwalle

07/08/2011 at 07:34PM