0

How can I add many formulas into a single code like finding a²,b²and c² at the same code

https://code.sololearn.com/cdBGReFObz9E/?ref=app

15th Sep 2023, 4:21 PM
P A Arrchith Iyer
P A Arrchith Iyer - avatar
4 odpowiedzi
+ 3
P A Arrchith Iyer Your code is correct, But error is here:- you want to calculate the square of 'b'. So use the same calculation as you did for 'a', which is multiplying 'a' by itself.... And remove unnecessary line`b = int(input())` See this modified version .. https://code.sololearn.com/cwAacqcqxIBV/?ref=app
15th Sep 2023, 4:53 PM
Darpan kesharwani🇮🇳[Inactive📚]
Darpan kesharwani🇮🇳[Inactive📚] - avatar
+ 3
P A Arrchith Iyer can you describe more what specify you want? In this code.. 'b' is calculated as 'a * a', which means 'b(b²)' is also equal to 49(a²) when 'a' is 7. So, output is 'Bottom Base = 49' when the user inputs 7.
15th Sep 2023, 5:27 PM
Darpan kesharwani🇮🇳[Inactive📚]
Darpan kesharwani🇮🇳[Inactive📚] - avatar
+ 1
b the Bottom base is squared like if I input 7 it shows Bottom Base =. 49 and sometimes the answer is incorrect Correct me if I am wrong
15th Sep 2023, 4:59 PM
P A Arrchith Iyer
P A Arrchith Iyer - avatar
0
but I think your answer is wrong There is a reason to add b Because there is no link between a and b we can only find c,a or b with two sides of the right angled triangle
16th Sep 2023, 5:28 AM
P A Arrchith Iyer
P A Arrchith Iyer - avatar