Home > Computer Programming > Simple conversion program

Simple conversion program

September 26, 2014 Leave a comment Go to comments

This was today’s task. If you didn’t manage to get it done today, please make sure that you have this code on your Google site and that you have provided accompanying pseudocode, complete with a brief outline of what is happening and preferably a screenshot of the console after the program has run.

print("1. Fahrenheit to Celsius")
print("2. Celsius to Fahrenheit")
x = input("Enter your choice: ")
value = input("Enter the value to be converted: ")
value = float(value)
if x == "1":
    output = (value - 32) * 5/9
else:
    output = value * 9/5 + 32
print(output)
Advertisements
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s