Am trying to learn some basic list comprehension in python and here's the code I was messing around with:
class myClass:
def __init__(self,num):
self.num = num
x = myClass(1)
y = myClass(2)
z = myClass(3)
obj = [x,y,z]
Here, I want to delete an object from the list "obj" whose self.num
value is 3, how do I do that?
Also assume every object in the list has it's own unique self.num
value.