Computer Science, asked by jayashreevirgo, 1 year ago

find and write the output of following python code names
['India','China','Srilanka','Pakistan']
print(names[-1][-1])

Answers

Answered by kashifahmed4
2

Answer:

N

Explanation:

When Indexing list, negative numbers mean that they are counted from last. So -1 would mean the last number.

names[-1][-1] would mean last letter of the last element that is the "n" of Pakistan.

Have a good day !

Similar questions