Kruptein 15 Posting Whiz in Training

I would instead of using seperate variables for the different materials, use a dictionary

#-*- coding: cp1252 -*-
substances = {
'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 = substances[a]*l*t
print answer

be aware that it will be case sensitive and Aluminium won't be recognised whereas aluminium is

vegaseat commented: helpful +15
Kruptein 15 Posting Whiz in Training

Bull >> Red Bull

Kruptein 15 Posting Whiz in Training

and what is your question?

Kruptein 15 Posting Whiz in Training

if digit is in string form: digit[:1] if the digit is an integer: str(digit)[:1] *or even easier: str(digit)[0]

Kruptein 15 Posting Whiz in Training

well I found out,
it had to be: os.system("xterm ~/localhost.desktop")

Kruptein 15 Posting Whiz in Training

yeah but u can get the info with php when the page loads.

Yes but that wasn't the question..