I am writing a function for a command line program that I intend to use at work for myself. I am very new to python and can't seem to find others that have the same issue as me anywhere online. When I get to the end of my 'if' statement if my input is 'y' or 'Y' the code in the program stops until I hit 'enter' and then it moves on to the next code block as intended. If my response falls under the 'else' category, the code performs the else block of code and moves on as intended. Why is my code not moving on in the 'if' section but moves on just find if input falls under the 'else' section. Hopefully that makes sense. Below I will post my function. Thank you.
def vct_choice():
vct_flooring = input("Is there any VCT on this job? (Y/N): ")
f.write("\n" "Is there any VCT on this job? (Y/N): ")
f.write(vct_flooring)
f.write("\n")
print("\n")
if vct_flooring == 'y' or vct_flooring == 'Y':
f.write("\n")
total_vct_sf = int(input("Please enter the total SF of VCT needed,
minus any waste: "))
print("\n")
print(vct_boxes + str(int(total_vct_sf * 1.1 // 45 + 1 + 5)))
print("\n")
print(vct_glue + str(int(total_vct_sf // 1200 + 1)))
f.write("Please enter the total SF of VCT needed, minus any waste:
")
f.write(input () )
f.write (str(total_vct_sf))
f.write("\n")
f.write("\n")
f.write(vct_boxes + str(int(total_vct_sf * 1.1 // 45 + 1 + 5)))
f.write("\n")
f.write("\n")
f.write(str(vct_glue))
f.write(str(int(total_vct_sf // 1200 + 1)))
f.write("\n")
print("\n")
print("\n")
else:
f.write("\n")
f.write("No VCT Needed")
f.write("\n")
print("No VCT Needed")
print("\n")
Aucun commentaire:
Enregistrer un commentaire