Initial work
This commit is contained in:
7
CS1032/practical-2023-10-18/fn1.py
Normal file
7
CS1032/practical-2023-10-18/fn1.py
Normal file
@@ -0,0 +1,7 @@
|
||||
def trapezium_area(w1, w2, h):
|
||||
return h * (w1 + w2) / 2
|
||||
|
||||
w1 = int(input("Width of the top: "))
|
||||
w2 = int(input("Width of the bottom: "))
|
||||
h = int(input("Height: "))
|
||||
print(f"Area is {trapezium_area(w1, w2, h)}")
|
||||
Reference in New Issue
Block a user