Bummer: Looks like you still need to remove some items from `messy_list`.
i del the string value and boolean value but still sying still need to remove
messy_list = ["a", 2, 3, 1, False, [1, 2, 3]] # Your code goes below here messy_list.insert(0, messy_list.pop(3)) del messy_list del messy_list
P S10,180 Points
Hey Ali, Task 1 looks good. For task two it doesn't look like you are deleting all of the correct values. Remember that 'list' is it's own data type. Even if a list contains all integers it still considered a list. So delete the list.
Also, someone was helping me the other day make a for loop that quickly went through the list and deleted everything that wasn't an 'int' data type. Check out the solution below and let me know if you have questions.
loop_list = messy_list.copy() for item in loop_list: if type(item) is not int: messy_list.remove(item)
del messy_list #for remove "a" and then click next del messy_list # for remove (Boolean) and then click next del messy_list # for remove [1, 2, 3,] and then click next
copy_list = messy_list.copy()
You don't need to print them
Ross Coe5,059 Points
I pilfered your code and tried it several times in the quiz console below question - kept getting an error so I tested in a workspace and I got back a blank list (I know your 'is not' should work) so then I googled is not of type and when I modified it worked both in workspace and quiz console - some people as getting inconsistent errors in the quiz consoles - on another occassion it simply was that I hadn't closed out a function by making sure I return over to the gutter - so python thought I was still defining the function - I'm only telling your my experience not saying your wrong ;)