Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #72329

Re: Yet another "simple" headscratcher

Newsgroups comp.lang.python
Date 2014-05-30 23:46 -0700
References <a7dbde77-6bec-4b04-a940-5e8beb926232@googlegroups.com> <mailman.10504.1401508949.18130.python-list@python.org>
Message-ID <9660e790-4734-4f41-a0bf-840b207c5a15@googlegroups.com> (permalink)
Subject Re: Yet another "simple" headscratcher
From wxjmfauth@gmail.com

Show all headers | View raw


>>> # from my lib
>>> def NewMat(nr, nc, val=0.0):
...     val = float(val)
...     return [[val] * nc for i in range(nr)]
...     
>>> import vmio6
>>> aa = NewMat(2, 3)
>>> vmio6.pr(aa)
(   0.00000e+000  0.00000e+000  0.00000e+000 )
(   0.00000e+000  0.00000e+000  0.00000e+000 )
>>> aa[0][0] = 3.1416
>>> vmio6.pr(aa)
(   3.14160e+000  0.00000e+000  0.00000e+000 )
(   0.00000e+000  0.00000e+000  0.00000e+000 )
>>> aa[1][1] = 1.2345
>>> vmio6.pr(aa)
(   3.14160e+000  0.00000e+000  0.00000e+000 )
(   0.00000e+000  1.23450e+000  0.00000e+000 )
>>>

jmf

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Yet another "simple" headscratcher Josh English <Joshua.R.English@gmail.com> - 2014-05-30 20:38 -0700
  Re: Yet another "simple" headscratcher Josh English <Joshua.R.English@gmail.com> - 2014-05-30 20:55 -0700
  Re: Yet another "simple" headscratcher Gary Herron <gary.herron@islandtraining.com> - 2014-05-30 20:57 -0700
  Re: Yet another "simple" headscratcher Ian Kelly <ian.g.kelly@gmail.com> - 2014-05-30 21:54 -0600
    Re: Yet another "simple" headscratcher wxjmfauth@gmail.com - 2014-05-30 23:46 -0700

csiph-web