I am trying to make a binary number checker that iterates through an integer but I have a problem
TypeError: 'int' object is not iterable
def sort(binary):
for char in int(binary):
if char < 1:
print("no")
elif char == 1:
print("yes")
else:
print("ERROR\t ERROR\t NOT A BINARY NUMBER")
def main():
print("Enter A Binary Number")
binary = input("")
sort(binary)
main()
How would I fix this?