[Tutor] Asterisk

Adam Vardy Adam Vardy <anvardy@roadrunner.nf.net>
Wed Dec 4 19:40:03 2002


Wednesday, December 4, 2002, 7:07:57 PM, you wrote:

>> At 06:48 PM 12/4/2002 -0330, Adam Vardy wrote:
>>  > Why does this happen? It is a strange expression.
>>  > >>> '%*.*f' % (6,3,1.41421356)
>>  > ' 1.414'

>> That's what I'd expect. Did you rtfm?

Well the answer is direct from the Python shell prompt. So anything it
says should be expected.

>
>> In your example there is (1) % (4) * (5) .* (7) f. What more can I say?

I don't follow this. I understand you're a manual kind of parsing guy.
But I just started learning Python this week. Anyone else want to explain
how it reaches the result?

If this should be obvious, the only thing I can expect to output 3
if I had an array (1,2,3) is if you said print somearray[3] or
something like that. And so it reaches for the third element. And that
is what I understand a computer can do.  It can compute. And if there
are a bunch of numbers in order, it can reach for a requested element
by adding that number from the start of the array.

I would say that a good programming language would require its
adherents to be able to paraphrase.

-- 
Adam Vardy