11-07-2009, 04:30 PM
Hey guys I made this for chemistry and I thought I would share
Temperature Converter
Temperature Converter
Code:
#Credits:
#Nevets04(I can't even count how much of his contributions helped me learn)
#Mr.FeellingLeSS(For the script that clears the shell for XP and Vista)
#Me?
import os
import platform
def clearer():
systemver=platform.release()
if systemver=='XP':
os.system("cls")
elif systemver=='Vista':
os.system("clear")
else:
os.system("clear")
clearer()
print '***************************** *'
print '* Welcome! '
print '* To the uber1337 '
print '* Temperature Converter '
print '******************************'
raw_input('Press Enter to continue')
clearer()
print 'For Farenheit to Celsius, Press:1'
print 'For Farenheit to Kelvin, Press:2'
print 'For Celsius to Farenheit, Press:3'
print 'For Celsius to Kelvin, Press:4'
print 'For Kelvin to Celsius, Press:5'
print 'For Kelvin to Farenheit, Press:6'
x = input('What is it that you want to convert?:')
clearer()
def choice():
if x==1:
a = input('Enter your degrees Farenheit here:')
print (a - 32) * 5/9
if x==2:
b = input('Enter your degrees Farenheit here:')
print (b - 32) * 5/9 + 273
if x==3:
c = input('Enter your degrees Celsius here:')
print c * 9/5 + 32
if x==4:
d = input('Enter your degrees Celsius here:')
print d + 273
if x==5:
e = input('Enter your degrees Kelvin here:')
print e - 273
if x==6:
f = input('Enter your degrees Kelvin here:')
print (f - 273) * 9/5 + 32
choice()
raw_input()