-1

Why don't the print methods work in the function total?

def main():
    firstAge = int(input('Enter your age:'))
    secondAge = int(input("Enter your best friend's age:"))

def total(firstAge,secondAge):
    response = sums(firstAge,secondAge)
    print(response)  

def sums(num1, num2):
    result = int(num1 + num2)
    return result

main()

1 Answer 1

0

Because you are not calling total function inside main function

change your main function to add total function inside like this

def main():
    firstAge = int(input('Enter your age:'))
    secondAge = int(input("Enter your best friend's age:"))
    total(firstAge,secondAge)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.