0

for the following code I am getting an error which says "ValueError: invalid literal for int() with base 10: '{'". Is something wrong in the way I compare 'i' with '{' , '}' and ','

c={1,2,3,4,5}
LE=[]  #to store even numbers
LO=[]   #to store odd numbers
for i in c:
    if(i != '{' or i != ',' or i != '}'):
        if(int(i)%2==0):
            LE.append(i)
        else:
            LO.append(i)
    else:
        continue

print(LE)            
print(LO) 

0 Answers0