Newby - is this what they are looking for ?? and is their a better a way

Gary Wood woodygar at sky.com
Tue Feb 24 07:54:28 EST 2009


''' 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.
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='')
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20090224/6a600edb/attachment.html>


More information about the Python-list mailing list