Putting asterisks around text

Martin martin at marcher.name
Mon Feb 9 17:13:57 EST 2009


Hi,

2009/2/9 todpose at hotmail.com <todpose at hotmail.com>:
> I'm trying to write a program that puts asterisks around the input text
> using while loop.
> I can do this without using while loop, but how can you do that using while
> loop?
>
> Example:
>
> Enter a string: Hello world
>
> **********
> *Hello world*
> **********

Since others have posted so helpful answer I'm just going to rant:

1) http://docs.python.org/ <- first part (make sure you read the docs
-- and tutorial -- for the python version you installed
2) After you know how to store user input in a variable think about
what other facts you know (by examining the content of the variable)
2) Think again hard what you need to output and which parts of the
output need to match the information you already have (by doing point
2)

That shouldn't be too hard

hth
Martin

-- 
http://soup.alt.delete.co.at
http://www.xing.com/profile/Martin_Marcher
http://www.linkedin.com/in/martinmarcher

You are not free to read this message,
by doing so, you have violated my licence
and are required to urinate publicly. Thank you.

Please avoid sending me Word or PowerPoint attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html



More information about the Python-list mailing list