The following code assigns a certain value to the a
variable depending on the range that the v
variable falls in.
if v>0 and v<1000:
c='green'
elif v>=1000 and v<2000:
c='yellow'
else:
c='red'
That works well, but I was wondering if there is a more Pythonic way to write the following conditional block.