2
Hello everybody all right?
I’m doing an activity for my python course, it’s a script that basically calculates the area of a wall in meters and tells how many liters of paint will be used. The problem is that when I type a very high value of height and width, type, 543.404 x 456.435 the script returns me the following result of area 2.3e+05, I wanted all the results to come with floating points and only two houses after the comma, follows my code. Obs: in my program 1 liter of paint paints 2m2 of area, so the variable t = 2.
Note: Someone helps me post the code correctly here on the site.
print('Bem vindo ao programa de orçamento\nde tintas: ')
l = float(input('Digite a largura da parede em metros: '))
print('Muito bem!')
a = float(input('Agora digite a altura da parede: '))
m = (l * a)
print ('Certo! Você tem uma área de: {:.2} metros' .format (l * a))
t = 2
print ('Para pintar esta parede, você vai\nprecisar de: {:.2} litros de tinta!'.format(m / t))
Hello! You can post code that allows playback of the problem?
– Pedro von Hertwig Batista
edited here friend
– Leandro Sargi