[Tutor] printing an acronym (fwd)
dyoo at hkn.eecs.berkeley.edu
Mon Sep 26 19:58:52 CEST 2005
Forwarding to tutor
---------- Forwarded message ----------
Date: Mon, 26 Sep 2005 08:32:02 -0500
From: Jason Massey <jason.massey at gmail.com>
To: Danny Yoo <dyoo at hkn.eecs.berkeley.edu>
Subject: Re: [Tutor] printing an acronym
Something like this:
... b = a.split()
... c = ""
... for d in b:
... return c
other than the horrible variable naming, it works.
>>> acro('international business machines')
On 9/25/05, Danny Yoo <dyoo at hkn.eecs.berkeley.edu> wrote:
> On Sat, 24 Sep 2005 andrade1 at umbc.edu wrote:
> > How could I get the following to print out an acronym for each phrase
> > entered such as if I entered random access memory it word print out RAM?
> Just out of curiosity, are you already familiar with Python's "lists"?
> If so, then you might want to try the slightly easier problem of pulling
> out acronyms out of a list of words. Extracting an acronym out of a list
> ["International", "Business", "Machines"]
> ==> "IBM"
> is not too bad, and is one step toward doing the original problem on the
> phrase "International Business Machines".
> Tutorials like:
> and the other tutorials on:
> should talk about lists. Please feel free to ask questions here!
> Tutor maillist - Tutor at python.org
More information about the Tutor