New course! Every coder should learn Generative AI!
Try a free lesson0
Who can make me the favor of helping me with this "perform a algorithm that allows to identify the type of triangle according to
In a loop with "for" and "up"
9 Answers
+ 5
Can you show us your attempt?
+ 1
You should then, try to solve it yourself first, we're only here to help.
Also, there is no "up" loop, only a "for" loop. A triangle only has three measurements, why use a loop at all?
Share more details if you got ant. How is the input taken, what should the output look like...
0
I have not done it, it's a job of a logarithm with a loop but I do not understand how it is done, you know?
0
Thanks
0
what type odmf triangle?
0
i have to identify the type of triangle according to your measures
0
Side measures or angle measures? By type of triangle, do you mean scalene/isosceles/equilateral or do you mean acute/right/obtuse?
If you have side measures and you want to know whether the triangle’s largest angle is acute, right, or obtuse, let a,b be the two shorter side lengths and let c be the longer. Then check whether a^2+b^2 is greater than, equal to, or less than c^2.
0
they explained it to me like this way in Spanish
1.Inicio
2. Leer (L1, L2, L3)
3. Escribir “Ingrese los 3 L (Lados)”
4.Si (L1<>L2 y L1<>L3) Entonces
5.Escribir “Es un equilátero”
Sino
6.Si (L1<>A o L2<>L3 o L3<>L2) Entonces
7.Escribir “Es un isósceles”
Sino
8.Escribir “Es un escaleno”
FinSi
Finsi
9.Fin
0
You could try something like:
L=[L1,L2,L3]
T=[]
for i in range(3):
T+=[ L[i]==L[(i+1)%3] ]
e=sum(T)
Then have different cases for e=0,1, and 3. I am not sure what you mean by using “up,” but at least this gets you a for loop.