-2
length = raw_input("what is the length of all you walls added together? ")
height = raw_input("what is the height of your room? ")
area = height*length
paint = raw_input("what paint would you like to use luxury paint, Standard quality, Economy quality? ")
if paint == "LP":
    answer = 2*area 
    print answer
if paint == "SQ":
    answer = 1.25*area  
    print answer
if paint == "EQ":
    answer = 0.55*area  
    print answer

This is the code it keeps saying that "typeerror: can't multiply sequence by non-int of type 'str'" does anyone have any idea?

i have another problem i need to set an range of what answers i can have which is between 2 and 25 for length and 1 and 6 for height while (length < 2) or (length > 25): wrong = raw_input("invalid number please try again? ") while (height < 1) or (height > 6): wrong = raw_input("invalid number please try again? ") this doesn't work it just says invalid number for everything

animuson
  • 53,861
  • 28
  • 137
  • 147
jaii1000
  • 1
  • 2
  • `height` is a string. `length` is a string. What do you expect `string * string` to do? – Aran-Fey Jun 04 '17 at 20:27
  • you're not binding the user inputs as `int` or `float` – gold_cy Jun 04 '17 at 20:27
  • i need them to be integers there supposed to be multiplied then what paint would they need would times that and then you would get a price for how much it is to paint – jaii1000 Jun 04 '17 at 20:28

1 Answers1

2

Convert the height and length to integers or floats, like this:

length = float(raw_input("what is the length of all you walls added together? "))
height = float(raw_input("what is the height of your room? "))
Don Kirkby
  • 53,582
  • 27
  • 205
  • 286