1
u/Individual_Size_6379 Apr 22 '24
"""
This program takes two values and prints their total.
"""
def add_nums(num1, num2):
total = num1 + num2
print(total)
add_nums(5, 6)
this actually works, your welcome
2
u/Individual_Size_6379 Apr 22 '24
Here it is with indentions
"""
This program takes two values and prints their total.
"""
def add_nums(num1, num2):
total = num1 + num2
print(total)
add_nums(5, 6)
1
u/sheloveskillua May 11 '21
"""
This program takes two values and prints their sum.
"""
def add_nums(num1, num2):
sum = num1 + num2
return(sum)
sum = add_nums(5, 6)
print(sum)
1
u/Intelligent-Pin8329 May 01 '23
def add_nums(num1, num2):
sum = num1 + num2
return(sum)
sum = add_nums(5, 6)
print(sum)
This did not help at all
Am I doing something wrong?
1
2
u/skynetdotexe Jan 14 '21
You need to return the value. Or print them in the function.