Help with python, comparing to values

Hello

I’m an amateur in using python and i need your help, I have a script that has this warning at python script node:

could someone help me with the problem? or a workflow that could replace the python node?
I know the problem is at line 20, and that from line 17 to 22 its comparing the diameter if its bigger than the value of D1 (which is an input by user at IN[3]), but both are integers! why isnt it working?

Can you show us your inputs just to be sure? Sometimes the warning returns the wrong line and it’s really one or two lines before. In this case, I’m thinking either x or D1 are not numbers.

Tag pipes.dyn (101.5 KB)

here is the whole script, it tags pipes, I just want to understand how it works

Hi, the warning says you have not given an integer as in input, but a character instead :slight_smile:

Since I don’t see the whole graph here, I would suggest that you get the diameter of the pipe and directly feed it to the python node, but in this case it could have returned a string (I think this is usually the case for pipes).

Try using ToNumber node:

image

for your IN[2] input, to make sure you give the script the correct data types to work with

We need to see the inputs you are providing since those inputs are giving you the error. We don’t know what your graph does or what your inputs are so we can’t replicate the issue.

Take another screenshot with the node preview bubbles pinned (or watch nodes) so we can see all the data that’s being fed to the python node.