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

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

110 active golfers, 334 entries

Solutions by @poeminlash:
42
#16 - Qing Liu / @poeminlash

08/07/2022 at 05:27AM

43
#>26 - Qing Liu / @poeminlash

08/07/2022 at 05:26AM

44
#>28 - Qing Liu / @poeminlash

08/07/2022 at 05:25AM

45
#>29 - Qing Liu / @poeminlash

08/07/2022 at 05:23AM

46
#>30 - Qing Liu / @poeminlash

08/07/2022 at 05:22AM

47
#>34 - Qing Liu / @poeminlash

08/07/2022 at 05:21AM

48
#>37 - Qing Liu / @poeminlash

08/07/2022 at 05:20AM

49
#>39 - Qing Liu / @poeminlash

08/07/2022 at 05:19AM

50
#>42 - Qing Liu / @poeminlash

08/07/2022 at 05:18AM

51
#>47 - Qing Liu / @poeminlash

08/07/2022 at 05:18AM

52
#>52 - Qing Liu / @poeminlash

08/07/2022 at 05:10AM

53
#>55 - Qing Liu / @poeminlash

08/07/2022 at 05:00AM

54
#>59 - Qing Liu / @poeminlash

08/07/2022 at 04:59AM

56
#>68 - Qing Liu / @poeminlash

08/07/2022 at 04:57AM

59
#>79 - Qing Liu / @poeminlash

08/07/2022 at 04:56AM