Python Forum
Help with Tempature Conversion Program
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with Tempature Conversion Program
#2
Which line is line 9 in your program? Above it is a blank line.

The error is associated with taking a float object and trying to use it like a function. As an example:

>>> f = 5.2   # This makes f a float object
>>> print(f)  # we can print f
5.2
>>> f()       # but we can't call f
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'float' object is not callable
It looks like you expect that con could at some point be "Stop". But if you're setting it this way:

con = float(input("Enter the desired tempature translation: "))
Then that isn't possible. You're casting the input value to a float. If someone typed in "stop", the float() conversion would fail and would generate an error.
Reply


Messages In This Thread
RE: Help with Tempature Conversion Program - by bowlofred - Oct-16-2020, 04:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Help with conversion program uwl 1 1,054 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