How to get Index of a index | Sololearn: Learn to code for FREE!


How to get Index of a index

['Ab','cd','ef','gh'] These are strings in a list. How to output 'b' from above list using index or any other way.. Use only python

6/16/2021 1:04:34 PM

Ishara Malshan De Silva

3 Answers

New Answer


a=['Ab', 'cd', 'ef', 'gh'] print(a[0][1])


arr=['Ab', 'cd', 'ef', 'gh'] print(arr[0]) #Output : Ab arr=['Ab', 'cd', 'ef', 'gh'] print(arr[0][1]) #Output: b #More arr=['Ab', 'cd', 'ef', 'gh'] print(arr[1]) #Output : cd arr=['Ab', 'cd', 'ef', 'gh'] print(arr[0][0]) #Output: A #More.......


arr=['Ab','cd','ef','gh'] Print (are[0][0]) 0utput=b