0

filter

Can anyone say why am I getting an attribute error??

15th Jul 2020, 6:57 AM
Mani
Mani - avatar
6 ответов
+ 3
Share your attempt that we can see where is error .
15th Jul 2020, 7:21 AM
Sâñtôsh
Sâñtôsh - avatar
+ 3
I assume you are looking for a way to filter all dicts in list that have 'noble' == True. Here is a try: https://code.sololearn.com/cdkOU61bdji6/?ref=app
15th Jul 2020, 3:20 PM
Lothar
Lothar - avatar
+ 2
You do not know how to use dictionaries, Mani . I advise you to read again the course. A dictionary is a collection that bind a hashable key to any value of any type. Example : a = {1: 2, "hi" : 3} print(a["hi"]) The keys of a dictionary aren't attributes, please remember that.
15th Jul 2020, 7:47 AM
Théophile
Théophile - avatar
+ 1
I tried to create dictionary under list
15th Jul 2020, 9:15 AM
Mani
Mani - avatar
+ 1
Then, why is that semicolon raising an syntax error
15th Jul 2020, 9:15 AM
Mani
Mani - avatar