ASSIGNMENT - 3 Sum or Product
Sum or Product
Write a program to print the sum of two numbers, A and B. If their sum is less than 10, otherwise print the product of numbers.
Input
The first line is an integer
A
.
The second line is an integer B
.Output
The output should be an integer.
Explanation
Given
A = 1
, B = 2
. Their sum is less than 10.So, the output should be
3
.Sample Input 1Sample Output 1
1 2
3
Sample Input 2Sample Output 2
42 10
420
a=int(input())
b=int(input())
x=a+b
z=a*b
if a+b <10:
print(x)
elif a*b:
print(z)
Comments
Post a Comment