Python Forum
Help with Tempature Conversion Program
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with Tempature Conversion Program
#1
Lightbulb 
I was given an assignment to traslate a program from javascript to Python (I don't know Javascript) and then to add in 2 while statements. I haven't made it very far into it yet, but each time I try to fix this program I keep getting the same error on line 9: "Line 9: TypeError: 'float' object is not callable" and I'm not sure how to fix it. I'm a beginner. Can anyone help me fix my error? Confused Huh
print("Tempture Conversion")
print("___________________")
f = float(input("Enter tempature in Farenhieght"))
con = float(input("Enter the desired tempature translation: "))
#this is a list of the options
print(" \n 1) Celcius \n 2) Kelvin \n 3) Rankine \n 4) Delisle \n 5) Newton \n 6) Reamur \n 7) Romer ")

#I was trying to do the math for the problems here

c = int((5/9)(f - 32))
k = int((f - 32) (5/9) + 273.15)
ra = int(k * 1.8)
de = int((212-f)*5/6)
N = int((f - 32)* 0.18333)
re = int((f - 32) / 2.25)
ro = int((f -32)*7/24+7.5)

#The while statement is supposed to repeat until the user types in "Stop" asking the same question in a loop cycle.

while( con != "Stop"):
    if(con == 1):
        print(" Tempature in Celcius: " + str(c))
    con = float(input("Enter the desired tempature translation:(Stop to stop) "))
Reply


Messages In This Thread
Help with Tempature Conversion Program - by booponion - Oct-16-2020, 04:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with conversion program uwl 1 1,645 Aug-19-2022, 09:08 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020