Python Question Bank
Python Question Bank
(b)
(c)
(d)
( e)
48. Solve a Python program that prints all the numbers from 0 to 6 except 3 and 6.
49. Enlist a simple program in Python to convert decimal number into binary, octal and
hexadecimal number system in Python.
50. Design and develop a Python program that display Fibonacci series.
51. Develop a Python program weather a given number is prime or not,
52. Validate a Python program for reverse a number.
53. Write a Python program that given number is palindrome or not.
54. Write a Python program weather a given number is positive or not.
55. Illustrate about List in Python programming language.
56. Explain the use of tuple in Python programming language.
57. Illustrate dictionary in Python programming language.
58. Solve nested list in Python programming language .
59. Explain the list method index() with an example.
60. Design about Creating a tuple in Python.
61. Explain basic operations in tuple.
62. Write about the following operations on dictionary i)len(). ii)min().
63. Explain the process of how to delete dictionary.
64. Mention and explain different List manipulations.
65. Illustrate an array. Write the syntax of defining an array with an example
66. Specify the process of importing array module.
67. Compare and contrast the differences between indexing and slicing.
68. Compare between actual and formal arguments with example.
69. Mention any three numpy() methods with examples.
70. List the advantages of array?
71. Write the difference between list and tuple.
72. Explain syntax of matrix in Python programming.
73. Write a Python array that accepts two values and finds their sum.
74. Summarize recursive function and illustrate with example program.
75. Explain about tuples and basic operations of tuples.
76. Discuss the following methods on dictionary i)index() ii)sorted() iii)max()
77. Explain the following methods i)append() ii)index()
78. Distinguish different List methods with examples
79. Explain how can we insert and extend list in Python with an example
80. Calculate a list of tuples by second item.
81. Explain a pop() and count()method for list in Python.
82. Discuss about the following methods in List: i)copy() ii)reverse() iii)extend()
83. With necessary examples and syntax of dictionary.
84. Write use of nested list in Python.
85. Explain creating an array in Python programming.
86. Explain how array can return same output with an example by using Python.
87. Describe the role of Python array.
88. Write multiplication of matrix by using Python.
89. Explain how transpose values with an example.
90. Discuss about array creation using numpy.
91. Write a Python program to implement pythagorean triplet in an array
92. Code by using ascending an array with examples.
93. Elucidate a code by using Python and separate array number is prime or not.
94. Write a Python program to check the given number is palindrome or not.
95. Create a Python program to merging two dictionary?
96. Write a Python program that implements i)Reverse a list. ii)Copy a list. iii)Insert a
number in list.
97. Design a Python program to find the first 5 digits in a list.
98. Write a Python program to convert a tuple into a dictioinary.
99. Write a Python program to update or delete a list.
100. Design a Python i)to test whether a number is even or odd. ii)to calculate factorial value
of numbers from 1 to 10
101. Write a Python program by using array and list.
102. Simplify a program for array using numpy.
103. Explain and write a code for array creation using numpy.
104. Solve a Python program to calculate slicing an array.
105. Convert array into zig-zag fashion in Python.
106. Justify a function. Write the syntax of defining a function with example
107. Specify the process of calling a function.
108. Write the difference between functions returning single value and functions returning
multiple values.
109. Compare actual and formal arguments with example.
110. Mention different types of arguments. Define positional arguments
111. List out the advantages of functions?
112. List out various methods that String contains.
113. Why functions in Python are called as first class objects? Explain.
114. Write a Python program that accepts two values and finds their sum.
115. Explain the following i)Defining a function ii)Calling a function
116. Explain how functions can return results with an example.
117. Describe the role of Python interpreter in functions. Explain possible ways of assigning a
function.
118. Draw and explain the steps involved in Towers of Hanoi problem through recursion.
119. Explain how a function can return multiple values with an example.
120. Discuss about i)Positional arguments ii)Variable length arguments
121. Write a Python program to implement Towers of Hanoi problem using recursion.
122. List and explain different ways of passing values to function with examples.
123. Design a Python function to check the given number is prime or not.
124. Write a Python function to check the given number is palindrome or not.
125. Write a Python function i)to test whether a number is even or odd. ii)to calculate
factorial value of numbers from 1 to 10
126. Develop a Python program to understand the positional arguments of a function.
127. Predict the output of following code
128. Design a Python function to sum all the numbers in a list. Sample List : (8, 2, 3, 0, 7)
Expected Output : 20
129. Solve a Python program to calculate factorial of a given number using recursion concept.
130. Why do developers prefer NumPy to similar tools like Matlab, Yorick?
131. List features that make NumPy unique?
132. Share the steps of NumPy installation in Windows?
133. Why is NumPy Array good compared to Python Lists?
134. Lists steps to create 1D, 2D, and 3D array.
135. How can you identify the datatype of a given NumPy array
136. What does bincount() function?
137. What is the use of "ndim" attribute in NumPy?
138. What is the use of "flipud" function in NumPy?
139. How can you reshape NumPy array?
140. Name a few use cases where NumPy is useful.
141. How many dimensions can a NumPy array have?
142. What is negative indexing in NumPy arrays?
143. How are NumPy Arrays better than Lists in Python?
144. Explain the data types supported by NumPy.
145. How do we create modules in Python?
146. What are the different ways of importing modules in Python?
147. What is the use of _init.py file?
148. Which module is used for working with CSV files in Python? Ans csv
149. Name the built-in function / method that is used to return the length of the object.
Ans len()
150. Name the function/method required for
(a) Finding second occurrence of m in madam. Ans (a) index or find()
(b) Get the position of an item in the list Ans (b) find() or index ()
151. Observe the following Python code and write the name(s) of the header file(s),
which will be
essentially required to run in a Python compiler.
X=randint(1,3)
Y=pow(X,3)
print(“hello”.upper()) Ans random,math,string
152. Create a NumPy Histogram with graphical representation.
153. Write a program for how to plot two histograms together in Matplotlib?
154. Write
. a program to create a stacked bar plot in Matplotlib
155. Write a program how to draw multiple lines with the help of matplotlib.
156. What is lambda function. Write properties of lambda function.
157. Difference between lambda and normal function call