Jason (toomanywhispers) wrote in littlescripts,
Jason
toomanywhispers
littlescripts

Hello! I'm Jason, the creator and mod of this community. To kick things off I'm going to offer a bit of my code. It's a Celcius to farenheit converter, Yeah I know it's not groundbreaking or anything but I have a friend in Canada and it's reduced the level of confusion in our IM conversations considerably.

(Note: Lj fouls up the whitespace so the periods are placeholders for spaces)


x = raw_input ('Do you want to convert a number from Farenheit to Celsius? ')
.
def conversion():
..........temp = input('Farenheit temperature?')
..........print (temp-32)*5/9
..........z = raw_input ('Do you want to exit?')
..........if z == "yes": print "Bye!"
..........else: conversion()
.
if x == "yes": conversion()
else: print "Bye!"



Future plans:

Make the conversion go either way (Cel.-->Far. and Far.-->Cel.)
Build a Tkinter gui.
Make it less finiky.




Edit: Lj messes up the whitespace formatting so I changed things around abit.
  • Post a new comment

    Error

    default userpic
  • 1 comment