#calculate cost of carpet length = float(input("Enter the longest dimension of room in metres: ")) width =float(input("Enter the shortest dimension of the room in metres: ")) if width<=4: if (length > 4): requiredLength=length requiredWidth=4 else: requiredLength=4 requiredWidth=width carpetCost = (requiredLength*requiredWidth)*10 print("Length of carpet supplied = ",requiredLength) print("Width of carpet supplied =",requiredWidth) print("Cost of carpet = £",carpetCost) else: print("You must enter a width less than or equal to four metres")