Multiplication or sum of two numbers

0 votes

Given two integer numbers, return their product only if the product is equal to or less than 1000, else return their sum.

def multiplication_or_sum(num1, num2):
    product = num1 * num2
    if product < = 1000:
        return product
    else:
        return num1 + num2

result = multiplication_or_sum(20,30)
print("The result is = ", result)


result = multiplication_or_sum(50,10)
print("The result is = ", result)

my output

The result is =  600
The result is =  500

expected output

The result is =  600
The result is =  60

Please help me in finding the error.

Feb 17, 2023 in Python by Arya
• 990 points

edited 5 days ago 6 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP