Answer the question
In order to leave comments, you need to log in
How to correct code for output if\else?
https://repl.it/@Joulence/vectorsfigure
There is such code. Works + - not bad, but there is a flaw. The code determines the sides of the triangle and often prints two results, or sometimes three. How to improve, change or even rewrite the code so that it always displays one value, and not more than one, as in the picture:
Everything is written in if \ elif
Answer the question
In order to leave comments, you need to log in
Weird question. Just such a conclusion is correct. According to your definition, your triangle is both simple (3 < 4+5; 4<3+5; 5<3+4) and rectangular 25= 9+16. What should the code do in such cases?
What would output "ONLY ONE" - your definitions (not code, but not definitions!) Must be mutually exclusive. You don't.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question