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

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

110 active golfers, 334 entries

Solutions by @the_ortemon:
65
#91 - Ортемон / @the_ortemon

06/28/2023 at 11:08AM

68
#>94 - Ортемон / @the_ortemon

06/28/2023 at 11:12AM

69
#>96 - Ортемон / @the_ortemon

06/28/2023 at 07:17AM

73
#>103 - Ортемон / @the_ortemon

06/27/2023 at 09:33PM

89
#>107 - Ортемон / @the_ortemon

06/27/2023 at 09:15PM