I cannot understand why Python is not doing what I am asking it to.
The method:
def IdentifyUVIndex(self, UVType):
if (UVType >= '1' and UVType <= '2'):
return "Low Exposure."
elif (UVType >= '3' and UVType <= '5'):
return "Moderate Exposure."
elif (UVType >= '6' and UVType <= '7'):
return "High Exposure."
elif (UVType >= '8' and UVType <= '10'):
return "Very High Exposure."
elif (UVType >= '11'):
return "Extreme Exposure."
else:
return "Unknown."
So if I type:
print main().IdentifyUVIndex('1')
it returns Low Exposure. Great! But as soon as I pass anything greater than 7 it immediately returns "Extreme Exposure".
Have I done something wrong? It should return Very High Exposure.
And if I pass '11' it should return extreme exposure but returns low exposure? This is so confusing!!