Python Forum

Full Version: I need help
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello. I am new to using python!
I am using python version 3!
The question I need help with is;
Write a program that accepts the lengths of three sides of a triangle as inputs. The program output should indicate whether or not the triangle is an equilateral triangle
Here is the code I have been using;
# print("Input lengths of the triangle sides: ")

x = int(input("x: "))

y = int(input("y: "))

z = int(input("z: "))

if x == y == z:

    print("Equilateral triangle")

else:

    print("Not Equilateral triangle")
The problem I am having is when I go to test it it says 2/3 and it is saying that I am failing the equilateral test.

X=5
Y=5
Z=5
Your code is correct as posted. Debug it by printing x, y, and z. If you are getting "2/3" then you are running something other than what is posted here.