I'm working on a project to create a postal bar code out of an inputted 5 digit zipcode. When I run the code, I get an error that says "can't assign to function call". What is wrong with the code, and how do I fix it?
zipcode = input("What is your 5 digit zipcode?")
s = zipcode.split(",")
def barcode(a):
if a==0:
print("||:::")
elif a==1:
print(":::||")
elif a==2:
print("::|:|")
elif a==3:
print("::||:")
elif a==4:
print(":|::|")
elif a==5:
print(":|:|:")
elif a==6:
print(":||::")
elif a==7:
print("|:::|")
elif a==8:
print("|::|:")
elif a==9:
print("|:|::")
for barcode(a) in s:
print(barcode(a))
total=int(zipcode[0])...tototal=sum(int(x) for x in zipcode). Much more readable and way easier for you to type.