Python Forum
def functions and floats
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
def functions and floats
#4
Just to add to what killerrex already said - you need to supply some number as argument c when calling function, e.g.
print celsius(10.0), i.e. you want to convert 10.0 degrees cecsius

also, more appropriate name of the function is fahrenheit (or something like celsius2farenheit) because you convert Celsius to farenheit, not the other way around

also instead of one char argument c, better use something descriptive like celcius
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
def functions and floats - by alwillia - May-26-2018, 06:40 PM
RE: def functions and floats - by buran - May-26-2018, 07:02 PM
RE: def functions and floats - by killerrex - May-26-2018, 07:23 PM
RE: def functions and floats - by buran - May-26-2018, 07:31 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Round off floats in a list nagymusic 10 4,813 Apr-02-2019, 12:43 AM
Last Post: nagymusic
  I need help with floats and int calloflegend11 4 3,838 Aug-27-2017, 10:29 PM
Last Post: BerlingSwe

Forum Jump:

User Panel Messages

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