Hi! On school we got exercise to calculate how much the length of substance grow when we know original length and temperature change.
So,the case goes that i have value temperature coefficient of different substances and i have to multiply them. I'd like to it without doing several condition statements. I tried to do a class and function but it didn't work out.
Here's the code, and i don't have any clue how to finish it. It should calculate
like aluminium*1meter*1celsius and print out answer without using condition statements, but is there a way to do it?
#-*- coding: cp1252 -*-
aluminium = 0.000023
concrete = 0.000012
silver = 0.000019
gold = 0.000014
copper = 0.000017
glass = 0.000008
a = raw_input("enter substance: ")
l = float(raw_input("give original length: "))
t = float(raw_input("how much the temperature changes: "))
answer = a*l*t
print'length changes', l, 'meters'