I
Id0x
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.
(e-mail address removed)
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();
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.
(e-mail address removed)
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():
#######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();