0

def main():

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

main()

error output:
Syntax Error:(line 8) fahrenheit = (9/5) * celsius + 32

This makes perfect sense to me. How can i fix this error?

4
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by hughesadam_87
2

a ')' at the end of line 1 is missing:

celsius = float(input("What is the Celsius temperature? "))

Edited by M.S.

Votes + Comments
sharp eye
1

Looks ike you are using Python3, so '/' will be floating point division and '//' an integer division. You can always test drive it ...

Python 3.2.3 (default, Apr 11 2012, 07:15:24) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> 2/3
0.6666666666666666
>>> 2//3
0
>>> 
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.