DEV Community

GioPort0
GioPort0

Posted on

Creating a home painting calculator

Hello, I'm developing a calculator that calculates the area of ​​a wall and displays the amount of paint needed to paint it. A simple exercise for beginners like me.
I want to implement the same code in an interface using the tkinter module.
I would like some tips

`l=float(input('Digite a largura da parede: '))
a=float(input('Digite a altura da parede: '))

area=l*a

print('A area de uma parede de {}m de largura, e {}m de altura é igual a {}m²'.format(l,a,area))
tinta=area/15
print('Você precisará de {}l de tinta para pintar a parede'.format(tinta))`

this my code :D

Top comments (3)

Collapse
 
steeve profile image
Steeve

Your code seems correct. The 15 should be a variable: it's the amount of area in square meters that can be covered by one litre of paint. This value depends on various factors such as the type of paint, the surface being painted, and the application method.

Collapse
 
draconith profile image
GioPort0

I liked your idea, in the morning I will implement the variable in the code. Thanks

Collapse
 
steeve profile image
Steeve

don't forget to try your calculation in real life by painting a wall :D