My issue
what should we use as value for ‘cost’ variable
My code
# Update your code below this line
s = 14
area = 4*s
cost =
Learning course: Learn Python
Problem Link: CodeChef: Practical coding for everyone
what should we use as value for ‘cost’ variable
# Update your code below this line
s = 14
area = 4*s
cost =
Learning course: Learn Python
Problem Link: CodeChef: Practical coding for everyone
Here in this code, we are firstly calculating the area of the square which is ( sideside) as it is given s=14 we are calculating (1414) as the area.
Next, in the question they have given cost of 7$/cm which means it charges 7$ for every centimeter.
So, we know that our area is 1414 =196
Now, we are multiplying are with the cost/cm (7$ with area) to get total cost of painting for that area.
s=14
area=ss
cost=7*area
print(area)
print(cost)
as given in the question Cost=7* area