Thanks, this makes sense. Problem is nothing is outputting. I am using elif statements over many times, like following. I don't know if this is the problem or indentation, or something else.
[HTML]elif (5 <= Height <= 6) and \
(1 <= Length <= 2) and \
(9 <= Width <= 5):
print fields[0] + ' Type1'
elif (8 <= Height <= 9) and \...
User Profile
Collapse
-
Since I am a beginner, your code makes the most sense to me. But I am confused about the object.append in the beginning. What is exactly a, b, c, and d and where did it come from. Is a, for example an id, followed by height, length, range? But in my file (that the code runs through), I have thousand of ids with their corresponding info (height, length, width) and the info is in ranges (from x1 - x2) like in my parameters (Type 1, Type 2), not specific...Leave a comment:
-
Here is an example that reflects what I am doing:
Id = fields [0]
Height = fields [1]
Length = fields [2]
Width = fields [3]
Then I have the parameters:
TypeX = (height range, length range, width range) ~ general
For example;
Type1 = (1.1 - 2.1, 3.2 - 5.3, .2 - .5)
Type2 = (1.0 - 2.0 , 2.3 - 4.2 , 1.2 - 2.8)
I want to write a code (but not sure how), so...Leave a comment:
-
I tried this but it didn't work. Actually, my ids = fields [0] (which correspond to fields [1] and fields [2] that I am using for defining parameters), so will that change anything? Also, this code runs and selects the id with the defined parameters. What if I had many different parameters? Will they just have thier own blocks in the code?
thanks again....Leave a comment:
-
sorry, i should have mentioned the whole thing because I am still unsure.
My x here is actually a list of values. And i have 2 lists of values that correspond to an id and I am trying to define parameters using the two lists. i just don't know the proper notation and such to write the code:
i am trying the following with no sucess:
>>> x = fields [1] -- my list
>>> y = filelds [2] -- 2nd...Leave a comment:
-
i need some help
I am a beginner in python language and I have the following question:
i am trying to define something, let say X, under certain limits and I am not sure how to do that.
basically i want to do the following: if X is less than 200 and greater than 100, then continue, else stop.
can someone provide some kind of starting point. i know i have to do a for loop, but not exactly sure how to go about it.
...
No activity results to display
Show More
Leave a comment: