Newbie! I'm a newbie! What's wrong with this program?

klappnase klappnase at
Mon Jul 21 01:29:10 CEST 2003

InsaneStewy at (Id0x) wrote in message news:<5da8e4b3.0307191800.48dc0a6d at>...

> There are 300
> None minutes in 5 hours <--- Problem occurs here
> [\|End Running of Program|/]
> Now the problem is... where does the "None" come from? And why is it
> there? Here is the code. Please email me if you can. Your help is
> appreciated.

The "None" comes from:

> def newLine():
>   print

What you meant was:
def newLine():
    print "\r"
(I must admit that I am not familiar with line endings on windoze, in
linux it is "\n", on windoze it might be "\r" or "\r\n", I don't know
for sure, however you don't need this function at all)

You might try something like:

print "There are " + str(minHour(x_hours)) + " minutes in " +
str(x_hours) + " hours"


More information about the Python-list mailing list