+ 2
Program for addition of two numbers
7 Answers
+ 6
Firstly,assign the the numbers to two different variables then add them and assign the sum to a new third variable.... U print out
A =5
B = 2
C = A+B
print(C)
This should work for Python
+ 2
a = 5
b = 2
c = a+b
print (c)
+ 2
def my_function(a,b):
a = int(a)
b = int(b)
result = int(a) + int(b)
print(result)
my_function(5,2)
or
def add(x,y)
return x+y
print(add(5,2))
+ 2
def addition(x, y):
return x+y
n1 = int(input("Enter first number"))
n2 = int(input("Enter second number"))
print("Result: ", addition(n1, n2))
+ 1
for inout of two numbers by user and then addition of that
+ 1
thaks to all
0
not working