#Python, (削除) 158 (削除ここまで)(削除) 154 (削除ここまで)(削除) 140 (削除ここまで) 139 bytes
Python, (削除) 158 (削除ここまで)(削除) 154 (削除ここまで)(削除) 140 (削除ここまで) 139 bytes
r=range
s=int(raw_input())
a=map(chr,range(65,91))
for i in r(0,s)+r(0,s-1)[::-1]:
print (' '.join(a[:i+1]+a[:i][::-1])).center(s*4-2,' '))
This is my first post so be gentle! I made heavy use of [::-1] to reverse strings, so maybe there's some optimization to be had there. Comments welcome.
EDITS:
Thanks @Rod for the pointer to the helpful link to the Python code golf topic and also for reminding me that the letters need spaces between them. Also thanks @wec for the general tips about removing spaces.
#Python, (削除) 158 (削除ここまで)(削除) 154 (削除ここまで)(削除) 140 (削除ここまで) 139 bytes
r=range
s=int(raw_input())
a=map(chr,range(65,91))
for i in r(0,s)+r(0,s-1)[::-1]:
print (' '.join(a[:i+1]+a[:i][::-1])).center(s*4-2,' '))
This is my first post so be gentle! I made heavy use of [::-1] to reverse strings, so maybe there's some optimization to be had there. Comments welcome.
EDITS:
Thanks @Rod for the pointer to the helpful link to the Python code golf topic and also for reminding me that the letters need spaces between them. Also thanks @wec for the general tips about removing spaces.
Python, (削除) 158 (削除ここまで)(削除) 154 (削除ここまで)(削除) 140 (削除ここまで) 139 bytes
r=range
s=int(raw_input())
a=map(chr,range(65,91))
for i in r(0,s)+r(0,s-1)[::-1]:
print (' '.join(a[:i+1]+a[:i][::-1])).center(s*4-2,' '))
This is my first post so be gentle! I made heavy use of [::-1] to reverse strings, so maybe there's some optimization to be had there. Comments welcome.
EDITS:
Thanks @Rod for the pointer to the helpful link to the Python code golf topic and also for reminding me that the letters need spaces between them. Also thanks @wec for the general tips about removing spaces.
- 31
- 2
#Python, (削除) 158 (削除ここまで) 154(削除) 154 (削除ここまで)(削除) 140 (削除ここまで) 139 bytes
import string
r = ranger=range
s = ints=int(raw_input())
a = string.uppercasea=map(chr,range(65,91))
for i in r(0,s) + r+r(0,s-1)[::-1]:
print (a[0:i+1] +' a[0'.join(a[:i+1]+a[:i][::-1])).center(s*2s*4-12,' '))
This is my first post so be gentle! I made heavy use of [::-1] to reverse strings, so maybe there's some optimization to be had there. Comments welcome.
EDITS:
Thanks @Rod for the pointer to the helpful link to the Python code golf topic and also for reminding me that the letters need spaces between them. Also thanks @wec for the general tips about removing spaces.
#Python, (削除) 158 (削除ここまで) 154 bytes
import string
r = range
s = int(raw_input())
a = string.uppercase
for i in r(0,s) + r(0,s-1)[::-1]:
print (a[0:i+1] + a[0:i][::-1]).center(s*2-1,' ')
This is my first post so be gentle! I made heavy use of [::-1] to reverse strings, so maybe there's some optimization to be had there. Comments welcome.
#Python, (削除) 158 (削除ここまで) (削除) 154 (削除ここまで)(削除) 140 (削除ここまで) 139 bytes
r=range
s=int(raw_input())
a=map(chr,range(65,91))
for i in r(0,s)+r(0,s-1)[::-1]:
print (' '.join(a[:i+1]+a[:i][::-1])).center(s*4-2,' '))
This is my first post so be gentle! I made heavy use of [::-1] to reverse strings, so maybe there's some optimization to be had there. Comments welcome.
EDITS:
Thanks @Rod for the pointer to the helpful link to the Python code golf topic and also for reminding me that the letters need spaces between them. Also thanks @wec for the general tips about removing spaces.
- 31
- 2
#Python, 158(削除) 158 (削除ここまで) 154 bytes
import string
r = range
s = int(raw_input())
a = string.uppercase
z = s*2-1
for i in ranger(0,s) + ranger(0,s-1)[::-1]:
print (a[0:i+1] + a[0:i][::-1]).center(zs*2-1, ' ')
This is my first post so be gentle! I made heavy use of [::-1] to reverse strings, so maybe there's some optimization to be had there. Comments welcome.
#Python, 158 bytes
import string
s = int(raw_input())
a = string.uppercase
z = s*2-1
for i in range(0,s) + range(0,s-1)[::-1]:
print (a[0:i+1] + a[0:i][::-1]).center(z, ' ')
This is my first post so be gentle! I made heavy use of [::-1] to reverse strings, so maybe there's some optimization to be had there. Comments welcome.
#Python, (削除) 158 (削除ここまで) 154 bytes
import string
r = range
s = int(raw_input())
a = string.uppercase
for i in r(0,s) + r(0,s-1)[::-1]:
print (a[0:i+1] + a[0:i][::-1]).center(s*2-1, ' ')
This is my first post so be gentle! I made heavy use of [::-1] to reverse strings, so maybe there's some optimization to be had there. Comments welcome.