I wrote this but I don’t understand why it is not working. By the way I am a beginner in programming.
fav_colours=[["bob"["likes:blue, hates:red"]],["john"["likes:red,hates:black"]],
["adam"["likes:purple,hates:pink"]]]
print fav_colours
I don’t think there is any error.Thanks in advance.
You need to separate each list item via a comma, so
["bob"["likes:blue, hates:red"]should be["bob", ["likes:blue, hates:red"].And it looks like you might need to use a
dictinstead of those inner lists.{"likes": "blue"}.