Create a new version of the program below that uses Boolean expressions (not true of false) for making the required decisions. Simplify the selection statements as much as possible. # Entering the sides of triangle a = int(input("Enter the length of first side :")) b = int(input("Enter the length of second side :")) c = int(input("Enter the length of third side :")) # CHECKING WHETHER TRIANGLE IS VALID OR NOT if(a + b >= c): if(a + c >= b): if(b + c >= a): print("Triangle is Valid") print("Perimeter is:",a+b+c) else: print("Triangle is Invalid") OUTPUT HAS TO BE Enter three edges: 1,1,1 The perimeter is 3 Enter three edges:1,3,1 The input is invalid
Create a new version of the program below that uses Boolean expressions (not true of false) for making the required decisions. Simplify the selection statements as much as possible.
# Entering the sides of triangle
a = int(input("Enter the length of first side :"))
b = int(input("Enter the length of second side :"))
c = int(input("Enter the length of third side :"))
# CHECKING WHETHER TRIANGLE IS VALID OR NOT
if(a + b >= c):
if(a + c >= b):
if(b + c >= a):
print("Triangle is Valid")
print("Perimeter is:",a+b+c)
else:
print("Triangle is Invalid")
OUTPUT HAS TO BE
Enter three edges: 1,1,1
The perimeter is 3
Enter three edges:1,3,1
The input is invalid
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images