<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Or a shorter version,<br>
<pre>a=lambda n: "".join([x[0].upper() for x in n.split()])
</pre>
Then it is just:<br>
<pre>>>> a('random access memory')
'RAM'
</pre>
<br>
<br>
<br>
<br>
Danny Yoo wrote:
<blockquote
cite="midPine.LNX.4.44.0509261058470.15723-100000@hkn.eecs.berkeley.edu"
type="cite">
<pre wrap="">Forwarding to tutor
---------- Forwarded message ----------
Date: Mon, 26 Sep 2005 08:32:02 -0500
From: Jason Massey <a class="moz-txt-link-rfc2396E" href="mailto:jason.massey@gmail.com"><jason.massey@gmail.com></a>
To: Danny Yoo <a class="moz-txt-link-rfc2396E" href="mailto:dyoo@hkn.eecs.berkeley.edu"><dyoo@hkn.eecs.berkeley.edu></a>
Subject: Re: [Tutor] printing an acronym
Something like this:
def acro(a):
...         b = a.split()
...         c = ""
...         for d in b:
...                 c+=d[0].upper()
...         return c
other than the horrible variable naming, it works.
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">acro('international business machines')
</pre>
</blockquote>
</blockquote>
</blockquote>
<pre wrap=""><!---->'IBM'
On 9/25/05, Danny Yoo <a class="moz-txt-link-rfc2396E" href="mailto:dyoo@hkn.eecs.berkeley.edu"><dyoo@hkn.eecs.berkeley.edu></a> wrote:
</pre>
</blockquote>
</body>
</html>