Category : list

Hello everyone i’m pretty new to pycharm and lists and i was wondering if i can remove duplicates from an old existing list: list=[1,2,4,4,1,4,2,6,2,9] and add new list to another list newlist=[1,2,4,6,9] i was trying to go for something like that: list=[1,2,4,4,1,4,2,6,2,9] newlist=[] for i in list: if list.count(1) > 1: newlist.append(1) print(newlist) but the ..

Read more

I want to combine this tedious code into one loop.How do I go about it ? There are two things which change – the color and the setpos value. I think we can use lists , but I am not sure how to do this since even if I take the Setpos value as (100,100), ..

Read more