FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!

problem4




A simple python program that accepts a string and displays it as shown in sample below:


Enter a string: nestor
-----n
----ee
---sss
--tttt
-ooooo
rrrrrr



1 blog comments below

answer:

s = raw_input('Enter a string:')
ln=len(s)
for i in range(ln):
print '%s%s' %('-'*(ln-1-i),s[i]*(i+1))
nfbueno78 on Sat Feb 11, 2012 6:24 pm



FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.