4 Replies - 9019 Views - Last Post: 12 December 2012 - 05:51 AM Rate Topic: -----

#1 iaremarie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 16
  • Joined: 22-September 12

How to convert Celsius to farenheit for python

Posted 23 September 2012 - 11:43 PM

writing a code that will convert celsius to farenheit

wont work what is wrong?

def main():

    celsius = float(input("What is the Celsius temperature? ")
    fahrenheit = 9.0 / 5.0  * celsius + 32
    print ("The temperature is ", fahrenheit, " degrees Fahrenheit.")
 
main() 


Is This A Good Question/Topic? 0
  • +

Replies To: How to convert Celsius to farenheit for python

#2 Simown  Icon User is offline

  • Blue Sprat
  • member icon

Reputation: 319
  • View blog
  • Posts: 650
  • Joined: 20-May 10

Re: How to convert Celsius to farenheit for python

Posted 23 September 2012 - 11:47 PM

You are missing a closing bracket at the end of line 3
Was This Post Helpful? 1
  • +
  • -

#3 atraub  Icon User is offline

  • Pythoneer
  • member icon

Reputation: 759
  • View blog
  • Posts: 2,010
  • Joined: 23-December 08

Re: How to convert Celsius to farenheit for python

Posted 24 September 2012 - 06:20 PM

While this is a fairly straightforward missing paren, always ALWAYS include the error message.
Was This Post Helpful? 1
  • +
  • -

#4 jon.kiparsky  Icon User is online

  • Pancakes!
  • member icon


Reputation: 7958
  • View blog
  • Posts: 13,564
  • Joined: 19-March 11

Re: How to convert Celsius to farenheit for python

Posted 24 September 2012 - 06:27 PM

Also, "code" is a mass noun. You don't write "a code", you write a program. If you spend an evening generating lines of python, you might say you're writing "lots of code", but not "lots of codes".

Sorry, little pet peeve.
Was This Post Helpful? 0
  • +
  • -

#5 eGrove Systems  Icon User is offline

  • New D.I.C Head

Reputation: -5
  • View blog
  • Posts: 10
  • Joined: 09-December 12

Re: How to convert Celsius to farenheit for python

Posted 12 December 2012 - 05:51 AM

Missing Close bracket at line 3 ,
celsius = float(input("What is the Celsius temperature? "))
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1