Python practice questions 1234
Python practice questions 1234
10. What is the difference between continue and pass statements in Python?
20. Define a variable num and assign an int value to it. Check the memory consumed by num.
25. Define a list of squares of even numbers from 2 to 20 using list comprehension.
Name
0 Amit
1 Sujata
2 Kalaipriya
3 Nitin
4 Ranjith
5 Arthi
6 Arvind
7 Gyan
8 Harshith
9 Neha
i. List
ii. Tuple
iii. Set
iv. String
50. Which function do we use to get the list of all the example datasets in Seaborn?
i. List
ii. NumPy array
i. List
ii. Array
i. List
ii. Array
61. What is the other name of figure and axes approach in Matplotlib?
68. What is the difference between count plot and bar plot?
73. Do we need to pass the extension while loading an example dataset in Seaborn?
74. Create a 2-D array of the shape 3*4 that has all the elements as 0.
75. Create an array of random integer values of the shape 4*4 and then convert into a 3D array of
array([[18],
[13],
[38],
[44]])
79. Create a dictionary using dict comprehension where keys are the even numbers from 2 to 10
80. Write a program to find the index of an element from the following list using binary search
method.
[10, 20, 30, 40, 50, 60, 70, 80]
82. There is a file abc.py that has the following code. If we execute it from the command prompt
what will be the output?
print(‘Hello’)
print(__name__)
83. If we import the above file abc.py in a Jupyter Notebook and then we execute the following
command. What will be the output?
print(abc. __name__)
84. What is a class in Python?
85. The variables are stored in which area in the memory in a .py file.
89. Print the list of all the available built-in names in Python.
98. Print the character that is available at the Unicode value 189.
99. Write the short cut key to convert the mode of a cell from markdown to code.