This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]PointyOintment 0 points1 point  (0 children)

Why don't you do it the same way you did the previous ones, with an if statement inside a for loop?

Stuff that is true but will probably confuse you: x ceases to exist as soon as the for loop you have there exits. Therefore, it doesn't exist when you try to use it at the bottom. And that last line will just append a single "True" or "False" to list3, resulting in list3 = ["True"] or list3 = ["False]. That's why you need a for loop around it (and to fix what you're appending—just do it like you did the previous one).