We offer you a brighter future with placement-ready courses - Start Now!!
This is a challenging Python Quiz With Answers. In this quiz, you will be able to practice different questions from various topics in Python. All the best!
0 of 30 Questions completed
Questions:
You have already completed the quiz before. Hence you can not start it again.
You must sign in or sign up to start the quiz.
You must first complete the following:
Quiz complete. Results are being recorded.
0 of 30 Questions answered correctly
Your time:
Time has elapsed
You have reached 0 of 0 point(s), (0 )
Earned Point(s): 0 of 0 , (0 )
0 Essay(s) Pending (Possible Point(s): 0 )
Show Question
1
Show Question
2
Show Question
3
Show Question
4
Show Question
5
Show Question
6
Show Question
7
Show Question
8
Show Question
9
Show Question
10
Show Question
11
Show Question
12
Show Question
13
Show Question
14
Show Question
15
Show Question
16
Show Question
17
Show Question
18
Show Question
19
Show Question
20
Show Question
21
Show Question
22
Show Question
23
Show Question
24
Show Question
25
Show Question
26
Show Question
27
Show Question
28
Show Question
29
Show Question
30
Review / Skip
Answered
Correct
Incorrect
Question 1 of 30
Which of the following is the error raised when a wrong data value is given to the operator or a method?
Question 2 of 30
What is the output of the below code?
Question 3 of 30
Which of the following modules allows you to view the data visually?
Question 4 of 30
Which of the following is a 3-dimensional data structure in pandas?
Question 5 of 30
What does the below code do?
from pymongo import MongoClient
client = MongoClient()
db=client.test
student = db.student
info = {
‘Name’: ‘ABC’,
‘Id’: ‘1’,
‘Age’: ’11’
}
student .insert_one(info)
Question 6 of 30
Which of the following is the correct code to change the information of one of the rows of the ‘student’ data?
Question 7 of 30
Which of the following keywords are used to handle the exceptions in Python?
Question 8 of 30
Which of the following is the code to read the columns cl1,cl2 from the table ‘tab’ using Pandas and sqlalchemy where the database engine is named as ’engine’?
Question 9 of 30
What does the below code do?
from sqlalchemy import create_engine
import pandas as pd
from pandas.io import sql
data = pd.read_csv(‘stds.csv’)
engine = create_engine(‘sqlite:///:memory:’)
data.to_sql(‘stds’, engine)
sql.execute(‘INSERT INTO stds VALUES(?,?,?)’, engine, params=[(5,’ABC’,2002)])
Question 10 of 30
Which of the following are not the methods to real data using sqlite3?
Question 11 of 30
What does the modes ‘a+’ let us access?
Question 12 of 30
Find the output of the below code?
Question 13 of 30
Which of the following code let’s us read data from an excel file?
Question 14 of 30
Which of the following Python modules is used for stemming, the process of getting different morphological variations given a root word?
Question 15 of 30
What is the output of the below code?
import numpy as np
arr=np.array([1,2,3,4,5.])
arr.dtype
Question 16 of 30
To which of the following codes give an error with the below array?
arr=np.array([[1,2,3],[4,5,6]])
Question 17 of 30
What does the below code output?
import xlrd
xl=xlrd.open_workbook(‘data.xlsx’)
data=xl.sheet_by_index(0)
for i in range(data.ncols):
print(data.cell_value(0,i),end=’,’)
Question 18 of 30
Which of the following is used to replace all the null values with 0 from the data frame df?
Question 19 of 30
What does the below code do if ‘dataFrame’ is a data frame and ‘Gender’ is one of its columns?
dataFrame[‘Gender’] = dataFrame[‘Gender’].map({‘M’: 0, ‘F’: 1, })
Question 20 of 30
What is the attribute used to set one of the plots as the dominant one when the two graphs coincide at some value?
Question 21 of 30
What is the output of the below code?
import numpy as np
arr = np.array([1,2,0,3,4,0,0,7,4,0,0,9])
print(np.where(arr == 0)[0].sum( ))
Question 22 of 30
Which of the following is the correct way to create a subplot with 3 columns and 2 rows and choose the first subplot to plot a graph?
Question 23 of 30
Which of the following is the correct code to concatenate two data frames having the same columns vertically such that the index values are continued?
Question 24 of 30
What is the output of the below code?
import statistics as st
st.mean({1:’a’,2:’b’,3:’c’,4:’d’,5:’e’})
Question 25 of 30
Which of the following is used to plot a 3D line plot with the variables as a,b,c on 3D axes named ‘axs’?
Question 26 of 30
What does the below code plot?
plt.scatter(a,b,marker=’D’)
Question 27 of 30
Question 28 of 30
What is the output of the below code?
import statistics as st
st.mean([])
Question 29 of 30
Which of the following gives the standard deviation of the column ‘clmn’ of the data frame ‘df’?
Question 30 of 30
What does the below give the statistical information of all the columns of the data frame?
Summary
Hope you enjoyed taking this Python Quiz With Answers. Happy learning!
Yes please. Hope I take more such quiz tests from you.
Thank you