I'm writing a small program to convert a string to an integer and then to binary within a list of strings. This is what I have
x=0
while x < len(list):
list[x]=bin(eval(list[x])
if(list[x].startswith("0b")):
list[x]=list[x].replace("0b","")
I am getting a syntax error on the colon of the if statement, I'm not sure why. Any help would be appreciated.