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

Id0x InsaneStewy at hotmail.com
Sun Jul 20 04:00:22 CEST 2003


I'm very new at programing, and while I was practicing I came across
something that confuses me. The code for the program is at the bottom.
The program it self is designed to convert hours to minutes. Now the
problem is, after I run the program I get strange results.


[\| Running the Program |/]

INPUT:
Ms-Dos Prompt:
C:\python23\> python practice.py

OUTPUT:

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.

InsaneStewy at hotmail.com

import math ##loads the math modual
########Start created Functions#########
##Function for converting minutes to hours##
def minHour(x):
  min = 60
  hour = min * x
  print hour
##Function creates a new line##
def newLine():
  print
#######End created Functions########
###Start Variables####
x_hours = 5
###End Variables####
newLine();
print "There are", minHour(x_hours), "minutes in", x_hours, "hours"; 
newLine();
print "Program Terminated.";
newLine();




More information about the Python-list mailing list