Posted by: Sourav | January 20, 2017

Another class 11 python assignment solved,python teacher sourav,kolkata 09748184075


import sys

s = raw_input(‘enter word\n’)
# print s
k=len(s)
if (k%2)==0:

for i in range(0, len(s)/2):

for j in range(0, len(s)):

if ((j == i) or (j == (len(s) – 1 – i))):

sys.stdout.write(s[j])

else:
sys.stdout.write(‘ ‘)

print
else:
for i in range(0, (len(s)/2)+1):

for j in range(0, len(s)):

if ((j == i) or (j == (len(s) – 1 – i))):

sys.stdout.write(s[j])

else:
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: