This is program for figuring out cost of carpet at X length Y Width and Z cost/sqft (turned to yard). I am not very strong in looping yet, but I am pretty sure that is what has to be done here. Ideally at the end I want to ask the user if they want to try for another carpet. If yes, loop back up to the beginning of the program, if no, exit. I am very new to python just started it this semester for my first IT class. Any help would be greatly appreciated.
Length=int(input("Enter Length of Carpet in Feet "))
retries=4
while Length<=0 or Length>=100:
print("Value out of Range. Please Re-Enter A Length Between, But Not Including, 0 And 100")
retries=retries-1
if retries<0:
raise IOError("Learn to Read Directions")
Length=int(input("Enter Length of Carpet in Feet "))
else:
print("Length Acceptable at ", Length)
print()
print()
Width=int(input("Enter Width of Carpet in Feet "))
retries2=4
while Width<=0 or Width>=200:
print("Value out of Range. Please Re-Enter A Length Between, But Not Including, 0 And 200")
retries2=retries2-1
if retries2<0:
raise IOError("Learn to Read Directions")
Width=int(input("Enter Length of Carpet in Feet "))
else:
print("Width Acceptable at ", Width)
print()
print()
Area=((Length*Width)/9)
print("Area is ", Area, "Square Yards")
Cost=(int(input("Enter Price/Sq.Ft. Of Carpet "))*9)
TotCost=Area*Cost
if TotCost<=5000:
print("I'll Purchase Selected Carpet")
else:
print("Carpet Is Too Expensive")
print()