Posted by: Sourav | December 20, 2016

Replaced k in the previous pattern,using just i,j,Python teacher Sourav,Kolkata 09748184075


import sys
S=’abracadabra’

for i in range(1,(len(S)*2),2):

for j in range((((2*len(S))-2)-(i-1)),0,-1):
sys.stdout.write(‘ ‘)
for j in range(i,0,-1):
sys.stdout.write(S[i/2])
sys.stdout.write(” “)

print

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: