+ 1

Can anybody help me with this code !

print("="*44) print("| *** Area Calculator program *** |") print("="*44) print("| Shape code list : |") print("| (R) = Rectangle |") print("| (T) = Trapezoid |") print("| (P) = Parallelogram |") print("| (C) = Circle |") print("-"*44) typ = input("Select Code[R,T,P,C] : ") if typ == "R" or typ == "r": print("you selected",typ,"=","Rectangle") elif typ == "T" or typ == "t": print("you selected",typ,"=","Trapezoid") elif typ == "P" or typ == "p": print("you selected",typ,"=","Parallelogram") elif typ == "C" or typ == "c": print("you selected",typ,"=","Circle") else : print("you selected",typ,"is invalid shape code!") print("Please try again") print() print("="*44) if typ == "R" or typ == "r": print(" Area of Rectangle") elif typ == "T" or typ == "t": print(" Area of Trapezoid") elif typ == "P" or typ == "p": print(" Area of Parallelogram") elif typ == "C" or typ == "c": print(" Area of Circle") print("-"*44) if typ == 'R' or typ == 'r': print('Input width and height in cm. or m.') unit = int(input('Select a unit code 1(cm.) or code 2 (m.): ')) w = int(input('Enter width : ')) h = int(input('Enter height : ')) elif typ == 'T' or typ == 't': print('Input parallel sides and height in cm. or m.') unit = int(input('Select a unit code 1(cm.) or code 2 (m.): ')) pa = int(input('Enter parallel side(a) : ')) pb = int(input('Enter parallel side(b) : ')) elif typ == "P" or typ == "p": print('Input base and height in cm. or m.') unit = int(input('Select a unit code 1(cm.) or code 2 (m.): ')) b = int(input('Enter base : ')) h = int(input('Enter height : ')) elif typ == "C" or typ == "c": print('Input radius in cm. or m.') unit = int(input('Select a unit code 1(cm.) or code 2 (m.): ')) r = int(input('Enter radius : ')) print("="*44) if typ == "R" or ty

1st Sep 2022, 1:40 PM
เเบงศ์ เเบงค์
2 Answers
+ 8
เเบงศ์ เเบงค์ please put your code in playground, save it there and post the link to this code here. your code is not comlete, because posts are limited in size. you should also give a description what your problem is.
1st Sep 2022, 1:59 PM
Lothar
Lothar - avatar
+ 3
Let's say, type is c. Then you want to calculate the area of a circle. The formula is r*r*3.14. So calculate the area and print the result. Do the same with all your other geometric figures. That's all (No, we won't code for you)
1st Sep 2022, 6:03 PM
Oma Falk
Oma Falk - avatar