Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (20.3k points)

Which types of objects fall into the domain of "subscribable"?

1 Answer

0 votes
by (119k points)

In Python, the subscripting is nothing but indexing since it is the same as a mathematical notation that uses actual subscripts. In Python, for example, we use array[0] to get the first element of the array and the mathematicians use a0 for the same thing. In simple words, objects which can be subscripted are called sub scriptable objects. In Python, strings, lists, tuples, and dictionaries fall in subscriptable category. 

If we use array[0], python implements array.__getitem__(0) to subscript the array. 

I recommend this Python Tutorial by Intellipaat to get started from the basics of Python. 

Related questions

0 votes
2 answers
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...