If function to classify submitted form

Hi,

I am just wondering if there’s a way to make my logic more simple here. I am trying to make a form where I could store some range of data and make them as a function. For instance, if I put a range of 1-2 and then later if I put any number in between these number for the next input, they will be classified and stored on the next column.

So far, I manage to make this:

I use for loop to generate the column and call the stored data in the dataframe, i will add the script if needed.

Thank you.

Cheers
IS