mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
added util function for adding lists by value
This commit is contained in:
parent
2e5a15c145
commit
59fbee7ece
@ -747,6 +747,16 @@ def average(*args):
|
||||
val += arg
|
||||
return val / len(args)
|
||||
|
||||
def addListsByValue(a, b):
|
||||
"""
|
||||
returns a new array containing the sums of the two array arguments
|
||||
(c[0] = a[0 + b[0], etc.)
|
||||
"""
|
||||
c = []
|
||||
for x, y in zip(a, b):
|
||||
c.append(x + y)
|
||||
return c
|
||||
|
||||
def boolEqual(a, b):
|
||||
"""
|
||||
returns true if a and b are both true or both false.
|
||||
|
Loading…
x
Reference in New Issue
Block a user