I have to add inputs just in case i have up to nine lines that i need to add feet values too. but im curious if i only have 5 lines to input is there a way to bypass the other inputs cause if i in put zero it has negative affects on the outcome.
So i had to add this to change it back for me which id rather be able to by pass it some how with my first input of how many lines of fence. also can yall let me know if im able to tighten up my code a bit.
if Line1 == 0:
Line1 = 8
if Line2 == 0:
Line2 = 8
if Line3 == 0:
Line3 = 8
if Line4 == 0:
Line4 = 8
if Line5 == 0:
Line5 = 8
if Line6 == 0:
Line6 = 8
if Line7 == 0:
Line7 = 8
if Line8 == 0:
Line8 = 8
if Line9 == 0:
Line9 = 8
fenceLines = int(input("How many lines of fence? "))
Line1 = int(input("Enter line one lineal feet. "))
Line2 = int(input("Enter line two lineal feet. "))
Line3 = int(input("Enter line three lineal feet. "))
Line4 = int(input("Enter line four lineal feet. "))
Line5 = int(input("Enter line five lineal feet. "))
Line6 = int(input("Enter line six lineal feet. "))
Line7 = int(input("Enter line seven lineal feet. "))
Line8 = int(input("Enter line eight lineal feet. "))
Line9 = int(input("Enter line nine lineal feet. "))
cornerPosts = int(input("How many corner posts? "))
endPosts = int(input("How many end posts? "))
gatePosts = int(input("How many gate posts? "))
if Line1 == 0:
Line1 = 8
if Line2 == 0:
Line2 = 8
if Line3 == 0:
Line3 = 8
if Line4 == 0:
Line4 = 8
if Line5 == 0:
Line5 = 8
if Line6 == 0:
Line6 = 8
if Line7 == 0:
Line7 = 8
if Line8 == 0:
Line8 = 8
if Line9 == 0:
Line9 = 8
Linea = round(Line1 / 8 - 1,0)
Lineb = round(Line2 / 8 - 1,0)
Linec = round(Line3 / 8 - 1,0)
Lined = round(Line4 / 8 - 1,0)
Linee = round(Line5 / 8 - 1,0)
Linef = round(Line6 / 8 - 1,0)
Lineg = round(Line7 / 8 - 1,0)
Lineh = round(Line8 / 8 - 1,0)
Linei = round(Line9 / 8 - 1,0)
x = 0
if fenceLines == 1:
x = 64
if fenceLines == 2:
x = 56
if fenceLines == 3:
x = 48
if fenceLines == 4:
x = 40
if fenceLines == 5:
x = 32
if fenceLines == 6:
x = 24
if fenceLines == 7:
x = 16
if fenceLines == 8:
x = 8
if fenceLines == 9:
x = 0
fenceLength = Line1 + Line2 + Line3 + Line4 + Line5 + Line6 + Line7 + Line8 + Line9 - x
eightGate = int(input("How Many 8 foot gates."))
fourGate = int(input("How Many 4 foot gates."))
post = 0
Price = 0
eightHinges = 0
eightGateLatch = 0
eightGateStop = 0
eightScrewGate = 0
eightEightFooters = 0
eightTenFooters = 0
if eightGate == 0:
Price = 0
eightHinges = 0
eightGateLatch = 0
eightGateStop = 0
eightScrewGate = 0
eightEightFooters = 0
eightTenFooters = 0
post = 0
if eightGate == 1:
Price = 100
eightHinges = 4
eightGateLatch = 1
eightGateStop = 1
eightScrewGate = 24
eightEightFooters = 4
eightTenFooters = 2
post = -1
if eightGate == 2:
Price = 200
eightHinges = 8
eightGateLatch = 2
eightGateStop = 2
eightScrewGate = 48
eightEightFooters = 8
eightTenFooters = 4
post = -1
if eightGate == 3:
Price = 300
eightHinges = 12
eightGateLatch = 3
eightGateStop = 3
eightScrewGate = 72
eightEightFooters = 12
eightTenFooters = 6
post = -1
if eightGate == 4:
Price = 400
eightHinges = 16
eightGateLatch = 4
eightGateStop = 4
eightScrewGate = 96
eightEightFooters = 16
eightTenFooters = 8
post = -1
price = 0
fourHinges = 0
fourGateLatch = 0
fourScrewGate = 0
fourEightFooters = 0
fourTenFooters = 0
if fourGate == 0:
price = 0
fourHinges = 0
fourGateLatch = 0
fourScrewGate = 0
fourEightFooters = 0
fourTenFooters = 0
if fourGate == 1:
price = 50
fourHinges = 2
fourGateLatch = 1
fourScrewGate = 12
fourEightFooters = 2
fourTenFooters = 1
if fourGate == 2:
price = 100
fourHinges = 4
fourGateLatch = 2
fourScrewGate = 24
fourEightFooters = 4
fourTenFooters = 2
if fourGate == 3:
price = 150
fourHinges = 6
fourGateLatch = 3
fourScrewGate = 36
fourEightFooters = 6
fourTenFooters = 3
if fourGate == 4:
price = 200
fourHinges = 8
fourGateLatch = 4
fourScrewGate = 48
fourEightFooters = 8
fourTenFooters = 4
linePosts = Linea + Lineb + Linec + Lined + Linee + Linef + Lineg + Lineh + Linei + cornerPosts + endPosts + gatePosts + post
concrete = round(linePosts * 0.75,0)
Boards = round(fenceLength * 12 / 5.5,0)
nails = round(Boards * 6,0)
stringers = fenceLength / 8 * 3
sixteenFoot = (fenceLength / 16) * 3
Nails = linePosts * 18
totalMaterialLabor = fenceLength * 10.00 + price + Price
totalLabor = fenceLength * 2.50
print ("Fence is", fenceLength , "lineal feet.")
print ("You need", linePosts , "posts.")
print ("You need", concrete, "bag(s) of 80 lb Quickcrete.")
print ("You need", Boards, "Fence boards.")
print ("You need", stringers + eightEightFooters + fourEightFooters, "8 footers.")
print ("You need", eightTenFooters + fourTenFooters, "Ten footer(s) for gate(s).")
print ("You need", nails, "1-7/8 in. Galvanized ring shank nails.")
print ("You need", Nails, "Three in. galvanized ring shank nails.")
print ("You need", eightGateLatch + fourGateLatch, "Gate latch(es).")
print ("You need", eightHinges + fourHinges, "Gate hinge(s).")
print ("You need", eightGateStop, "Gate stop(s).")
print ("You need", eightScrewGate + fourScrewGate, "Three inch screws.")
print ("Estamated cost is $", totalLabor + price + Price, "or $", totalMaterialLabor, " for materls and labor.")