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


Groups > comp.lang.python > #98843

What function is 'u0, j = random(), 0'?

X-Received by 10.50.128.234 with SMTP id nr10mr9753588igb.12.1447554234010; Sat, 14 Nov 2015 18:23:54 -0800 (PST)
X-Received by 10.50.73.165 with SMTP id m5mr25242igv.4.1447554233932; Sat, 14 Nov 2015 18:23:53 -0800 (PST)
Path csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!news.glorb.com!i2no2639371igv.0!news-out.google.com!l1ni4735igd.0!nntp.google.com!i2no2639363igv.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.python
Date Sat, 14 Nov 2015 18:23:53 -0800 (PST)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=50.100.117.144; posting-account=SZ_svQkAAACWRFG2bDA-zgq8ILyl4-vo
NNTP-Posting-Host 50.100.117.144
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <f2965552-575a-44fc-9c34-dbc4792d4208@googlegroups.com> (permalink)
Subject What function is 'u0, j = random(), 0'?
From fl <rxjwg98@gmail.com>
Injection-Date Sun, 15 Nov 2015 02:23:53 +0000
Content-Type text/plain; charset=ISO-8859-1
Xref csiph.com comp.lang.python:98843

Show key headers only | View raw


Hi,

When I read the below code, I cannot make the last line (with ######) out.



def res(weights):
  n = len(weights)
  indices = []
  C = [0.] + [sum(weights[:i+1]) for i in range(n)]
  u0, j = random(), 0  ######


If I run below code on console, it will say an error.

uu, 0.1, 0


What difference is between these two example lines?

Thanks,

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


Thread

What function is 'u0, j = random(), 0'? fl <rxjwg98@gmail.com> - 2015-11-14 18:23 -0800
  Re: What function is 'u0, j = random(), 0'? Zachary Ware <zachary.ware+pylist@gmail.com> - 2015-11-14 20:47 -0600
  Learning Python from the tutorial (was: What function is 'u0, j = random(), 0'?) Ben Finney <ben+python@benfinney.id.au> - 2015-11-15 14:03 +1100

csiph-web