我有一个问题: 我有两个列表与列表逻辑运算符
Pipe_sizes = [15,15,22,15,32,45]
Flow_rate = [0.1,0.3,1,2,0.4,1.5]
我想用逻辑运算符更改列表PIPE_SIZE这样的:
if Flow_rate <= 0.2 then the pipe size is 15
if Flow_rate > 0.2 and <= 1 then the pipe size is 22
if Flow_rate > 1 and <=1.9 then the pipe size is 32
if Flow_rate > 1.9 then the pipe size is 45
我该怎么办呢?
你所说的“变化的意思列表'Pipe_size'“?你的意思是从'Pipe_sizes'中选择一个值? –
我不清楚你的规则是从哪里来的。例如。 > 1.9 = 45从哪里来?为什么1.9? –
你想用两个列表和“bisect”来做到这一点。 –