Write a python program to find the cost of painting the fence of rectangular plot of length
15m and breadth 40m; the height of the fence is 2m. The cost of painting is Rs 20 per square
meter. Each line of code must have an explanation regarding its purpose as a comment beside
the code line itself.
Answers
Answered by
1
Answer:
l = 15 #length of the plot
b= 40 #breadth of the plot
h = 2 #height of fence
p = 2*(l+b) #Perimeter of the plot
print ("Length of the plot=",l,'m','\n','Breadth of the plot=",b,'m','\n',"Height of the plot=",h,'m') #Display all the dimensions
f = p*h # Area of the fence
c = 20 # Cost of painting per metre square
print ("Cost of painting per metre square= Rs.", c, 'per m**2')
Cost = f*c #Area multiplied by cost
print ("Total cost of painting the fence of rectangular plot = Rs.", Cost) #Display final cost
print ("Thank You")
Similar questions