Top Python Interview Questions
Mobiprep handbooks are free downloadable placement preparation resources that can help you ace any company placement process. We have curated a list of the 40 most important MCQ questions which are asked in most companies such as Infosys, TCS, Wipro, Accenture, etc. The placement handbooks also have detailed explanations for every question ensuring you revise all the questions with detailed answers and explanations.
Question
9
Explanation
List data types supported in python.
Python has five standard data types:
Numbers
Strings
Lists
Tuples
Dictionaries
Question
10
Explanation
What are negative indexes and why are they used?
The index for the negative number starts from ‘-1’ that represents the last index in the sequence and ‘-2’ as the penultimate index and the sequence carries forward like the positive number.
The negative index is used to remove any new-line spaces from the string and allow the string to except the last character that is given as S[:-1]. The negative index is also used to show the index to represent the string in the correct order.
Question
11
Explanation
When does a dictionary is used instead of a list?
>Dictionaries – are best suited when the data is labeled, i.e., the data is a record with field names.
>lists – are a better option to store collections of un-labeled items say all the files and subdirectories in a folder. List comprehension is used to construct lists in a natural way.
>Generally, Search operation on dictionary object is faster than searching a list object.
Question
12
Explanation
List some features of python programming.
>It provides very high-level dynamic data types and supports dynamic type checking.
>It supports automatic garbage collection.
>It can be easily integrated with C, C++, COM, ActiveX, CORBA, and Java.
>It supports functional and structured programming methods as well as OOP.
>It can be used as a scripting language or can be compiled to byte-code for building large applications



.png)