The assignment that i need to do is make a code in python that accepts three numbers from a user and displays a message if the sum of any two numbers equals the third.
this is my pseudcode is
start
input num1, num2, num3
if (num1 + num2 = num3) or (num1 + num3 = num3) or (num2 + num3 = num1) then
output "some of any two numbers is equal to the third"
end if
stop
this is my code so far not sure how to do the if part
num1 = input("Enter number 1: ")
num2 = input("Enter number 2: ")
num3 = input("Enter number 3: ")
num1 = int(num1)
num2 = int(num2)
num3 = int(num3)
if num1 + num2 == num3
Aucun commentaire:
Enregistrer un commentaire