Help me in solving VAR10 problem

My issue

My code

#replace the _ with the correct value to solve this problem 
s = 10
areas = s*s

l = 25
b = 17
arear = l*b

#In this example, area of rectangle is higher than the area of the square
areadiff = areas  - arear
costs = areas * 4

print("The area of Square is", areas )
print("The area of Rectangle is",  arear )
print("The difference of areas is", areadiff)
print("Cost of painting the Square is", costs)

Learning course: Learn Python
Problem Link: CodeChef: Practical coding for everyone

I suppose you are getting areadiff as a negative value.

The comment already tells us that arear (area of rectangle) is greater than areas (area of square). So, areadiff should have been ;

areadiff= arear - areas

1 Like