So say I have something that looks like this:
def probability_color():
if color == 'red':
return float(3/10)
so essentially it should return .30 instead of anything longer. My specific problem includes fractions that aren't as clean as this example so I'm getting very long decimal float values in this particular scenario. Is there a simple solution that would format it rather than using something like round()?