Interview Questions for python

Interview Questions for Python




Question : 1
What is the difference between a keyword and an identifier?

View Solution



Question : 2
What are literals in Python? How many types of Literals allowed in Python?

View Solution



Question : 3
How many types of sequences are supported in Python?

View Solution



Question : 4
What factors guide the choice of identifiers in program?

View Solution



Question : 5
What is the difference between an expression and a statement in Python?

View Solution



Question : 6
What are tokens in Python? How many types of tokens allowed in Python?

View Solution



Question : 7
What is the role of indentation in Python?

View Solution



Question : 8
What are data types? What are Python built in core data types?

View Solution



Question : 9
Which data types of Python handle Numbers?

View Solution



Question : 10
What do you understand by term immutable?

View Solution



Question : 11
What are mutable and immutable types in Python? List both of them.

View Solution



Question : 12
What are augmented assignment operators? How are they useful?

View Solution



Question : 13
Why are logical errors harder to locate?

View Solution



Question : 14
What is an Exception?

View Solution



Question : 15
Why is Exception Handling is required?

View Solution



Question : 16
What is the need for debugger tool?

View Solution



Question : 17
What are main error types? Which types are most dangerous and why?

View Solution



Question : 18
What is a difference between an error and exception?

View Solution



Question : 19
What is debugging and code tracing?

View Solution



Question : 20
What are nested Lists?

View Solution



Question : 21
Discuss the utility and significance of Lists.

View Solution



Question : 22
What is the purpose of the del operator and pop method? Try deleting a slice.

View Solution



Question : 23
What are list slices?

View Solution



Question : 24
What do you understand by true copy of a list? How is it different from shallow copy?

View Solution



Question : 25
What do you understand by immutability?

View Solution



Question : 26
How are Tuples different from Lists when both are sequences?

View Solution



Question : 27
Discuss the utility and significance of Tuples.

View Solution



Question : 28
How can you say that a tuple is an ordered list of objects?

View Solution



Question : 29
How are dictionaries different from Lists?

View Solution



Question : 30
When are dictionaries more useful than lists?

View Solution



Question : 31
Discuss the utility and significance of Dictionaries.

View Solution



Question : 32
Why is a dictionary termed as an unordered collection of objects?

View Solution



Question : 33
How is clear() function different from del Statement?

View Solution



Question : 34
What is the significance of modules?

View Solution



Question : 35
What is dot notation of referring to objects inside a module?

View Solution



Question : 36
What is a function? How is it useful?

View Solution



Question : 37
What is Pandas library of Python? What is its significance?

View Solution



Question : 38
How is Series data structure different from a DataFrame data structure?

View Solution



Question : 39
What is a DataFrame object? How it is created in Python?

View Solution



Question : 40
What are advantages of CSV file formats?

View Solution



Question : 41
What is sqlite3 library of Python?

View Solution



Question : 42

Can nongraphic characters be used in Python ? How ? Give examples to support your answer.

View Solution



Question : 43

What is a cross-platform software?

View Solution



Question : 44

What are the advantages of Python programming language?

View Solution



Question : 45

What are some limitations of Python programming language?

View Solution



Question : 46

In how many different ways, can you work in Python?

View Solution



Question : 47

What are advantages/disadvantages of working in Interactive mode in Python?

View Solution



Question : 48

What are the advantages/disadvantages of working in script mode in Python?

View Solution



Question : 49

How are keywords different from identifiers ?

View Solution



Question : 50

How are floating constants represented in Python ? Give examples to support your answer.

View Solution



Question : 51

How are string-literals represented and implemented in Python ?

View Solution



Question : 52

What are operators ? What is their function ? Give examples of some unary and binary operators.

View Solution



Question : 53

What is an expression and a statement ?

View Solution



Question : 54

What all components can a Python program contain ?

View Solution



Question : 55

What do you understand by block/code block/suite in Python ?

View Solution



Question : 56

What are variables ? How are they important for a program ?

View Solution



Question : 57

What do you understand by undefined variable in Python ?

View Solution



Question : 58

What is Dynamic Typing feature of Python ?

View Solution



Question : 59

What is the common structure of Python compound statements?

View Solution



Question : 60

What is the importance of the three programming constructs?

View Solution



Question : 61

What is empty statement in Python? What is its need?

View Solution



Question : 62

Which Python statement can be termed as empty statement?

View Solution



Question : 63

What is an algorithm?

View Solution



Question : 64

What is a flowchart? How is it useful?

View Solution



Question : 65

What is entry-controlled loop?

View Solution



Question : 66

What are the four elements of a while loop in Python?

View Solution



Question : 67

What is the difference between else clause of if-else and else clause of Python loops?

View Solution



Question : 68

In which cases, the else clause of a loop does not get executed?

View Solution



Question : 69

What are jump statements? Name them.

View Solution



Question : 70

How and when are named conditions useful?

View Solution



Question : 71

What are endless loops ? Why do such loops occur?

View Solution



Question : 72

How is break statement different from continue?

View Solution



Question : 73

Define Operator and Operand.

View Solution



Question : 74

What is the use of type()?

View Solution



Question : 75

The modulus operator is used to produce the quotient in division. Is it True or False ? 

View Solution



Question : 76

Describe the use parentheses in expressions.

View Solution



Question : 77

Describe how Python evaluates an expression containing parentheses.

View Solution



Question : 78

Explain the use of the assignment operator.

View Solution



Question : 79

What is the difference between Expressions and Operators?

View Solution



Question : 80
Example not (boolean Not) with an example.

View Solution



Question : 81
Example not (boolean Not) with an example.

View Solution



Question : 82

Example and (boolean AND) with example.

View Solution



Question : 83

Example or (boolean OR) with example.

View Solution



Question : 84

Explain Associativity of operators wit6h example.

View Solution



Question : 85

What is the difference between * and **? Explain with an example.

View Solution



Question : 86

What is the difference between << (left shift) and >> (right shift) operators ?

View Solution



Question : 87

What is the difference between & (bit-wise AND), and I  (bit-wise OR) operators?

View Solution



Question : 88

Explain not ( boolean NOT ) with an example

View Solution



Question : 89
What is an expression ?

View Solution



Question : 90

What is a statement ?

View Solution



Question : 91

What do you mean by floor division ?

View Solution



Question : 92

What is the difference between "=" and "=="  ?

View Solution



Question : 93

What don you mean by precedence and associativity of operators ?

View Solution



Question : 94

What are Identity and Membership operators ?

View Solution



Question : 95

Explain different bitwise operators.

View Solution



Question : 96

What will be the result of 5.0/3 and 5.0 / / 3 ?

View Solution



Question : 97
What is the difference between + and * operators of List ?

View Solution



Question : 98

What is boolean data type ? Explain with an example.

View Solution



Question : 99

What is the difference between pow() and**?

View Solution



Question : 100

What is the deference between expression and statement ?

View Solution



Question : 101

What is the difference between num = 20 and num == 20?

View Solution



Question : 102

What is conditional branching ?

View Solution



Question : 103

What is looping ?

View Solution



Question : 104

Explain if statement.

View Solution



Question : 105

Explain range() function ?

View Solution



Question : 106

Mention the similarity and difference between break and continue statements.

View Solution



Question : 107

What is the function of break statement in a while or for loop ?

View Solution



Question : 108

What is the use of Control structures ?

View Solution



Question : 109

How many types of control structures are there ? Explain.

View Solution



Question : 110

Explain Selection logic.

View Solution



Question : 111

What do you mean by flow-of-control ?

View Solution



Question : 112

What do you mean by selection statements ?

View Solution



Question : 113

What is the minimum number of iteration that while loop could make ?

View Solution



Question : 114

What is the difference between entry controlled loop and exit-controlled loop?

View Solution



Question : 115

What are jump statements ?

View Solution



Question : 116

What is Iteration ?

View Solution



Question : 117

What are strings ?

View Solution



Question : 118

Differentiate between physical line and logical line.

View Solution



Question : 119

What is the difference between (+) and (*) operators?

View Solution



Question : 120

What is the difference between Istrip() and rstrip() ?

View Solution



Question : 121

What do you mean by' strings are immutable ?

View Solution



Question : 122

What is the function of slicing operation ?

View Solution



Question : 123

What is the use of Docstrings ?

View Solution



Question : 124

How are empty strings represented in Python ?

View Solution



Question : 125

"The quotes are not a  part of strings". Comment.

View Solution



Question : 126

Differentiate between ord() and chr() functions.

View Solution



Question : 127

Write short note on subscript.

View Solution



Question : 128

 What do you mean by positive and negative indices ?

View Solution



Question : 129

'String indices must be an integer'. Comment.

View Solution



Question : 130

 What do you mean by traversing a string ?

View Solution



Question : 131

Write short note on membership operators.

View Solution



Question : 132

What is the significance of list ?

View Solution



Question : 133

Lists are mutable. Comments ?

View Solution



Question : 134

Why are Python Lists called dynamic arrays ?

View Solution



Question : 135

How do list indices work in Python ?

View Solution



Question : 136
Explain count() method with example.

View Solution



Question : 137

What is index() method used for ?

View Solution



Question : 138

What is aliasing ? Explain with an example.

View Solution



Question : 139

What do you mean by sequence ?

View Solution



Question : 140

What is indexing ?

View Solution



Question : 141

What is the default value for the first index if you omit the first index value in a slice ?

View Solution



Question : 142

What is the default value for the second index if you omit the second index value in a slice?

View Solution



Question : 143

What is the purpose of negative slice indices ?

View Solution



Question : 144

Explain the functions of del statement, pop() and remove().

View Solution



Question : 145

If two list are equivalent, is it necessary that they are identical also. Explain with an example.

View Solution



Question : 146
Name three types of sequence objects.

View Solution



Question : 147

Which item in the sequence is selected for an index value of - 1?

View Solution



Question : 148

Just like C, C++, and Java, Python supports character type; True or False ?

View Solution



Question : 149

How are lists formed ?

View Solution



Question : 150

What are the characteristics of list ?

View Solution



Question : 151

What is tuple ?

View Solution



Question : 152

A tuple in Python is immutable. Comment.

View Solution



Question : 153

What is the difference between objects and methods ?

View Solution



Question : 154

Is an item assignment an a tuple possible ?

View Solution



Question : 155

What is len() function used for in list and tuple?

View Solution



Question : 156

What is the use of in operator ?

View Solution



Question : 157

Write short note on tuple assignment.

View Solution



Question : 158

How will you create tuple with zero element and 1 element ?

View Solution



Question : 159

Compare and contrast tuples and list.

View Solution



Question : 160

Can we update tuples?

View Solution



Question : 161

What is the difference between list and tuple ?

View Solution



Question : 162

Identity the following as mutable or immutable:
lists, numbers, strings, tuples and dictionaries.

View Solution



Question : 163

How will you create an empty tuple ?

View Solution



Question : 164

What is dictionary?

View Solution



Question : 165

Compare and contrast dictionaries (dicts) with other Python data types.

View Solution



Question : 166

What are the advantages of hash ?

View Solution



Question : 167

Does Python store dictionary elements in any particular order?

View Solution



Question : 168

What is a mapping ?

View Solution



Question : 169

What is another name for mapping ?

View Solution



Question : 170

What are the characteristics of a Python dictionary?

View Solution



Question : 171

A dictionary is an mutable object. Comment.

View Solution



Question : 172

A dictionary is an unordered collection of objects. Comment.

View Solution



Question : 173

Can sequence operations, such as slicing and concatenation, be applied to dictionaries?

View Solution



Question : 174

Write the syntax of a dictionary.

View Solution



Question : 175

Can you remove key:value pairs from a dictionary. If so, how ?

View Solution



Question : 176

What do you mean by traversing a dictionary ?

View Solution



Question : 177

Can you merge two dictionaries ? If so, how?

View Solution



Question : 178

Discuss the properties of Dictionary Keys.

View Solution



Question : 179

What do the keys(), values() and items() functions do ?

View Solution



Question : 180

Write different capabilities of dictionary.

View Solution



Question : 181

Write difference between lists and dictionaries.

View Solution



Question : 182

What is the purpose of a header file in a Python program?

View Solution



Question : 183

What is function ?

View Solution



Question : 184

What are the advantages of using functions.

View Solution



Question : 185

What is function definition ?

View Solution



Question : 186

Write a short note on built-in function.

View Solution



Question : 187

How is built-in function accessed ?

View Solution



Question : 188

How will you import all functions in the math module ?

View Solution



Question : 189

What is difference between cell() and floor() functions?

View Solution



Question : 190

What is Python module ?

View Solution



Question : 191

How will you import specific names only within a module?

View Solution



Question : 192

Write short note on user defined function.

View Solution



Question : 193

What is difference between pow() and **?

View Solution



Question : 194

What do you mean by Regular expressions ?

View Solution



Question : 195

What is a metacharacter?

View Solution



Question : 196

How match() function is different from search() function ?

View Solution



Question : 197

What do you mean by greedy match and non greedy match ?

View Solution



Question : 198

Differentiate between max() and min() functions ?

View Solution



Question : 199

Write a short note on random module.

View Solution



Question : 200

Write a short note on randint().

View Solution



Question : 201

Observe the following Python function and write the name(s) of the module(s) to which they belong:
a. uniform()  b. findall()

View Solution



Question : 202

What is file Pointer ?

View Solution



Question : 203

Discuss various modes to open a file.

View Solution



Question : 204

Write short note on binary mode of opening a file.

View Solution



Question : 205

Differentiate between read() and readline().

View Solution



Question : 206

Write function of a+ mode.

View Solution



Question : 207

What are different ways to read from a file ?

View Solution



Question : 208

What are command line arguments?

View Solution



Question : 209

Why do we use command line arguments ?

View Solution



Question : 210

What is the use of getopt method ?

View Solution



Question : 211

What are the different file processing modes supported by Python ?

View Solution



Question : 212

What is pickling and unpickling in Python ?

View Solution



Question : 213

What is the use of offset ?

View Solution



Question : 214

Write a statement in Python to open a text file DATA.TXT so that new contents can be written in it.

View Solution



Question : 215

Differentiate between readlines() and readline() functions.

View Solution



Question : 216

Name two functions which allow us to access a file in a non-sequential or random mode.

View Solution



Question : 217

Name the file which is stored in human readable form and can also be created using any text editor.

View Solution



Question : 218

What is the use of seek() and tell() methods?

View Solution



Question : 219

What is the use of close() method ?

View Solution



Question : 220

What do you understand by module and package ?

View Solution



Question : 221

What do you mean by LEGB ?

View Solution



Question : 222

What is namespace in Python ?

View Solution



Question : 223

Name any two commonly used build-in modules.

View Solution



Question : 224

What do you mean by Global variable ?

View Solution



Question : 225

What do you mean by Built-in ?

View Solution



Question : 226

What do you understand by following import statement :
from x import a, b, c

View Solution



Question : 227

What do you mean by reloading module ?

View Solution



Question : 228

How will you import all the attributes from a module ?

View Solution



Question : 229

Write short note on from-import statement.

View Solution



Question : 230

What is numpy ?

View Solution



Question : 231

Name the module you will import to use numpy ?

View Solution



Question : 232

What is slicing ?

View Solution



Question : 233

What do you mean by Axes in numpy ?

View Solution



Question : 234

What do you mean by Rank in numpy ?

View Solution



Question : 235

Write short note on slicing.

View Solution



Question : 236

What is the purpose of negative index values in NumPy ?

View Solution



Question : 237

Define Array and NumPy array.

View Solution



Question : 238

Explain membership operator in with example.

View Solution



CCC Online Test 2021 CCC Practice Test Hindi Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level NIELIT Study material and Quiz Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Website development Company in Allahabad