![]() | copy a text from book into wingIDE |
|
03 Dec 2012, 22:20
J.J. Bosman (3 posts) |
When I copy a text from the epub Pract progr. like |
|
03 Dec 2012, 23:03
J.J. Bosman (3 posts) |
import temperature I do not know whaT this is. |
|
05 Dec 2012, 18:23
Paul Gries (35 posts) |
Hi J.J., It looks like a font problem between epub and Wing. I copied and pasted your code and it had syntax errors for me. I also tried copying and pasting from the PDF version, and that one actually worked. Here’s what I have in temperature.py:
def to_celsius(t):
return (t - 32.) * 5 / 9
def above_freezing(t):
return t > 0
And here is my shell interaction: >>> import temperature >>> temperature.above_freezing(temperature.to_celsius(33.3)) True My guess for what caused your problem is that, because there was a syntax error in your temperature.py file, the functions weren’t getting properly define. |
| You must be logged in to comment |

