14,739,403 members
1.00/5 (1 vote)
See more:
This is my code
```def introduction():
print('this program will give you the result of multiplication, division and addition of two numbers')
def num1():
return n1
def  num2():
return n2
def a(num1,num2):
get_sum=num1+num2
return get_sum
def pyt():
introduction()
#this will give you the two numbers
number1=num1()
number2=num2()
a(number1,number2)
print(a)
pyt()```

What I have tried:

I searched in other online resources
Posted
Updated 21-Oct-20 22:24pm
v2
Patrice T 22-Oct-20 3:08am

What is the problem with your code ?

## Solution 1

[update, thanks to Richard]
There's nothing wrong with your program.
Actually there is an error in your code, as well spotted by Richard:
Quote:
a(number1,number2)
print(a)

```result = a(number1,number2)
print(result)
```
[/update]

I would have written it this way
```def introduction():
print('this program will give you the result of multiplication, division and addition of two numbers')

n=int(input(prompt))
return n

result = num1 + num2
return result

def pyt():
introduction()
#this will give you the two numbers
print('the result is ' +  str(result))

pyt()```

but it's just matter of taste.
v2
Richard MacCutchan 22-Oct-20 4:22am

+5. More than a matter of taste, your code works.
CPallini 22-Oct-20 4:34am

Thank you Richard, anyway the OP code works as well.
Richard MacCutchan 22-Oct-20 5:04am

No, the OP code prints the address of function a, not its result.
CPallini 22-Oct-20 5:21am

OOPS, I stand corrected!
Thank you, Richard.