how do I get this to add up?
Hey guys i am new to python, this is my code. but the problem is , it is not adding up, I need the output to come up as a total of seconds. like this
[I]print_seconds(1,2,3) #this input will output the following
def print_seconds(hours, minutes, seconds):
print(hours * 3600 / 1)
print(minutes * 60 / 1)
print(seconds * 1 / 1)
you have to create a variable called sum at the top.
sum = 0
Then, instead of printing the values to the screen, add them to sum. Then print sum