Skip to content

Instantly share code, notes, and snippets.

@mayankdawar
Created August 7, 2020 20:43
Show Gist options
  • Save mayankdawar/c028693947868f08a4264bf1acdc693a to your computer and use it in GitHub Desktop.
Save mayankdawar/c028693947868f08a4264bf1acdc693a to your computer and use it in GitHub Desktop.
The variable nested contains a nested list. Assign ‘snake’ to the variable output using indexing.
nested = [['dog', 'cat', 'horse'], ['frog', 'turtle', 'snake', 'gecko'], ['hamster', 'gerbil', 'rat', 'ferret']]
output = nested[1][2]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment