Newby - is this what they are looking for ?? and is their a better a way
Chris Rebert
clp2 at rebertia.com
Tue Feb 24 08:06:14 EST 2009
On Tue, Feb 24, 2009 at 4:54 AM, Gary Wood <woodygar at sky.com> wrote:
> ''' program.
> 1.What type of data will the input be? What type of data will the output be?
> 2.Get the phrase from the user.
> 3.Convert to upper case.
> 4.Divide the phrase into words.
> 5.Initialize a new empty list, letters.
> 6.Get the first letter of each word.
> 7.Append the first letter to the list letters.
> 8.Join the letters together, with no space between them.
> 9.Print the acronym.
You're not doing 5 or 7-9 right. Where's the `letters` list they asked for?
> Which of these steps is in a loop? What for statement controls this loop?
> '''
>
> line = input('enter a phrase')
> lines = line.upper()
> seq = lines.split()
> for i in seq:
> word = (i[0])
> print(word, end='')
Hint: `print` shouldn't be used inside the loop at all.
Cheers,
Chris
--
Follow the path of the Iguana...
http://rebertia.com
More information about the Python-list
mailing list