Plutonic Rainbows

More Functions

Another attempt at multiplication with slightly better output. Of course, it doesn’t need to be math-based - you can use anything. That’s the beauty of it.

#multiply two numbers and divide by the third.

def calc(value1, value2, value3):
	return value1 * value2 / value3
	
value1 = (float(raw_input("\nThe number: ")))

value2 = (float(raw_input("\nMultiplied by: ")))

value3 = (float(raw_input("\nDivided by: ")))

answer = calc(value1, value2, value3)

print "\n{0:.0f} multiplied by {1:.0f} and divided by {2:.0f} is: {3:.1f}\n".format (value1, value2, value3, answer)