I need to write a program that reads values and then uses them to calculate areas of different geometric shapes. My problem is: how to enter data on the same line? Example: 3.0 4.0 2.0 followed by calculation on the next line
How to write the code so that Python reads on the same line? Is it even with raw_input?
How do I do:
a = float(raw_input())
b = float(raw_input())
c = float(raw_input())
triangulo = (a * c) / 2
print "TRIANGULO:", ("%.3f" % triangulo)
circulo = (3.14159 * c**2 )
print "CIRCULO:", ("%.3f" % circulo)
trapezio = ((a + b) * c) / 2
print "TRAPEZIO:", ("%.3f" % trapezio)
quadrado = b * b
print "QUADRADO:", ("%.3f" % quadrado)
retangulo = a * b
print "RETANGULO:", ("%.3f" % retangulo)