【发布时间】:2013-03-12 13:55:06
【问题描述】:
我有一个定义来分隔特定属性的一些坐标。 对于这种分离,我使用 1 个定义,在定义中我有 9 个列表(不同的标准)。现在对于输出,我只想要我定义的列表。否则我不能用它来绘图。
def sorteerCord(cord):
tweestijging=[]
stijginggelijk=[]
stijgingdaling=[]
tweedaling=[]
dalinggelijk=[]
dalingstijging=[]
tweegelijk=[]
gelijkstijging=[]
gelijkdaling=[]
y=0
while y<len(cord):
lijst=cord[y]
if (lijst[1]-lijst[0])>0.5:
if (lijst[2]-lijst[1])>0.5:
tweestijging.append(y)
if (lijst[2]-lijst[1])<=0.5 and (lijst[2]-lijst[1])>=-0.5:
stijginggelijk.append(y)
if (lijst[2]-lijst[1])<-0.5:
stijgingdaling.append(y)
if (lijst[1]-lijst[0])<-0.5:
if (lijst[2]-lijst[1])>0.5:
dalingstijging.append(y)
if (lijst[2]-lijst[1])<=0.5 and (lijst[2]-lijst[1])>=-0.5:
dalinggelijk.append(y)
if (lijst[2]-lijst[1])<-0.5:
tweedaling.append(y)
if (lijst[1]-lijst[0])<=0.5 and (lijst[1]-lijst[0])>=-0.5:
if (lijst[2]-lijst[1])>0.5:
gelijkstijging.append(y)
if (lijst[2]-lijst[1])<=0.5 and (lijst[2]-lijst[1])>=-0.5:
tweegelijk.append(y)
if (lijst[2]-lijst[1])<-0.5:
gelijkdaling.append(y)
y=y+1
print raw_input()
return raw_input()
他们是在我的 def 中定义输出文件的一种方式吗 (def sorteerdCord(cord,outpu=tweestijging)
【问题讨论】:
-
“输出文件是什么样的”是什么意思?它是什么样的?
-
根据谷歌翻译,我发现这是荷兰语。但是,如果您将变量名称更改为在英语中更有意义,这对所有人都会有用,因为像我这样不会说/不懂荷兰语的人必须查找名称。
标签: python user-defined-functions