[Tutor] How can I extract a specific sublist from a nested list?

Lie Ryan lie.1296 at gmail.com
Wed Mar 11 08:41:48 CET 2009


Emad Nawfal (عماد نوفل) wrote:
> Hi Tutors,
> How can I extract a specific sublist (??) from a nested list, for 
> example, 

The same as the way you extract other objects from non-nested list

> if I want to extract the sublist ["ADJ", "good"], 

nested_list[1][2]

> or the bigger 
> sublist  ["NP",["DET", "The"],["ADJ", "good"],["NOUN", "man"]]

nested_list[1]



More information about the Tutor mailing list