Jan-31-2017, 11:26 AM
Length=float(input("Enter the length: ")) Width=float(input("Enter the width")) Floor_Type=input("Enter the option Premium/P, Durable/D or Economy/E: ") #These are the inputs for the code, The first two are float as the decimal matters when dealing with length of wood. the floor type is a string as it is not a numerical value Area=Length*Width if Floor_Type == "P" or "Premium": Materials=Area*21.4 elif Floor_Type == "D" or "Durable": Materials=Area*12.9 elif Floor_Type == "Economy" and "E": Materials=Area*7.99 else: print("Please enter a Floor type from the list provided.(Case Sensitive)Whatever I entered at
Floor_Type
, always firs if statement is picked. When I enter 'D'
or 'Durable'
or 'Economy'
or 'E'
still the first calculation (Materials=Area*21.4)
is performed. Any ide why is that?