Python lists .omit

This problem is from the practice pack in the computer science path. I don’t remember learning .omit in the course and I’m not sure how to answer this problem. What is the answer and how does .omit work?

what does important_data look like? Or you can provide the lesson?

.omit seems to be a property added to the data by who-ever created that data list

so we could omit certain data if desired.

That’s all the info from the practice pack. There’s no other info and i can’t even link this because it is just a random problem from the practice pack

I have no idea what the data is, but I suspect the data pack contains a list with objects (class instance) which have a .omit property

can’t you do: print(data_list), and copy that code to the forum so I have an idea what the data pack looks like?


I moved on from that problem and I can’t access it anymore. I just wanted to see if someone else could figure it out but nevermind. I’m just gonna move on

I still by my point that its a property of the object/class instance. Given the syntax used, I am 90% sure. The extra 10% would have been nice (to see the data/exercise), but isn’t a must

1 Like

Hello @stetim94,
I accessed this problem myself today and I am also stuck.
To answer your question, if you print the data list you get: [2, 6, 123, 81, 30, 582, 553, 893]
If you print the type of the number, print(type(number)), you get
<class 'important_data.ImportantNumber'>
Dunno if this helps to figure it out.

I came across the same thing today. I also didn’t learn omit, and when I was searching it up, found this forum.
I still don’t know what omit is, or most of this problem, but the idea is that it wants you to skip the number if the .omit thing is true.
I don’t know how or who set the omit, but to skip the number, you can put “continue” in the code.
So where the # notes are where it says to update the line, I just put continue in there, and got the problem right.

your data_list contains objects/class instances. This object has an omit property which is either set to True or False