FREE Online Courses: Dive into Knowledge for Free. Learn More!
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!
Time limit: 0
Quiz Summary
0 of 30 Questions completed
Questions:
Information
You have already completed the quiz before. Hence you can not start it again.
Which of the following is the error raised when a wrong data value is given to the operator or a method?
Correct
Incorrect
Question 2 of 30
2. Question
What is the output of the below code?
raise
Correct
Incorrect
Question 3 of 30
3. Question
Which of the following modules allows you to view the data visually?
Correct
Incorrect
Question 4 of 30
4. Question
Which of the following is a 3-dimensional data structure in pandas?
Correct
Incorrect
Question 5 of 30
5. Question
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)
Correct
Incorrect
Question 6 of 30
6. Question
Which of the following is the correct code to change the information of one of the rows of the ‘student’ data?
Correct
Incorrect
Question 7 of 30
7. Question
Which of the following keywords are used to handle the exceptions in Python?
Correct
Incorrect
Question 8 of 30
8. Question
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’?
Correct
Incorrect
Question 9 of 30
9. Question
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)])
Correct
Incorrect
Question 10 of 30
10. Question
Which of the following are not the methods to real data using sqlite3?
Correct
Incorrect
Question 11 of 30
11. Question
What does the modes ‘a+’ let us access?
Correct
Incorrect
Question 12 of 30
12. Question
Find the output of the below code?
assert -4>0
Correct
Incorrect
Question 13 of 30
13. Question
Which of the following code let’s us read data from an excel file?
Correct
Incorrect
Question 14 of 30
14. Question
Which of the following Python modules is used for stemming, the process of getting different morphological variations given a root word?
Correct
Incorrect
Question 15 of 30
15. Question
What is the output of the below code?
import numpy as np
arr=np.array([1,2,3,4,5.])
arr.dtype
Correct
Incorrect
Question 16 of 30
16. Question
To which of the following codes give an error with the below array?
arr=np.array([[1,2,3],[4,5,6]])
Correct
Incorrect
Question 17 of 30
17. Question
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=’,’)
Correct
Incorrect
Question 18 of 30
18. Question
Which of the following is used to replace all the null values with 0 from the data frame df?
Correct
Incorrect
Question 19 of 30
19. Question
What does the below code do if ‘dataFrame’ is a data frame and ‘Gender’ is one of its columns?
Yes please. Hope I take more such quiz tests from you.
Thank you