wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

python test no 1

Total questions: 30

Worksheet time: 3600secs

Name
Class
Date
1.

Which Python library runs a function as thread?

a)

None

b)

_threading

c)

threading

d)

thread

2.

How does run() method is invoked?

a)

By Thread.run()

b)

By Thread.start()

c)

By Thread.create()

d)

None

3.

Which method is used to identify a thread?

a)

getThread()

b)

None

c)

getName()

d)

get_ident()

4.

How does global value mutation used for thread-safety?

a)

via GIL (Global Interpreter Lock)

b)

via Locking

c)

via Mutex

d)

None

5.

What is the method to retrieve the list of all active threads?

a)

getList()

b)

getThreads()

c)

enumerate()

d)

threads()

6.

Which thread method is used to wait until it terminates?

a)

waitforthread()

b)

join()

c)

None

d)

wait()

7.

Race conditions are …

a)

Two threads incorrectly accessing a shared resource

b)

Testing which thread completes first

c)

Something you should add to your code

d)

The weather on race day

8.

Full form of API

a)

Application Process Interchange

b)

Application Programs Interchange

c)

Application Process Interface

d)

Application Programming Interface

9.

To display all the databases of MySQL with the help of cursor mycursor , command will be

a)

mycursor.execute("SHOW DATABASES")

b)

mycursor.execute("DESC DATABASES")

c)

mycursor.executes("SHOW DATABASES")

d)

mycursor.execute("SHOW ALL DATABASES")

10.

After inserting the data we need to issue

a)

rollback

b)

set autocommit

c)

mycur.commit(1)

d)

mycur.commit()

11.

Which connector is used to connect the MySQL with Python?

a)

mysql.connector

b)

pysql

c)

MyMySQL

d)

Mysql.pymysql

12.

What is the name of host for signing into a database of MySQL?

a)

Local

b)

Myhost

c)

local host

d)

localhost

13.

To open a connection with MySQl we use following library function of imported library:

a)

connectme

b)

connect

c)

Con.connector

d)

None of these

14.

State True or False: Role of execute() is to execute the MySQL queries which pertain to a database or table.

a)

True

b)

False

15.

Which software is used for coding the Python language?

a)

Idea

b)

IDLE

c)

python Script

d)

Connector

16.

Which command is used for counting the number of rows in a database?

a)

row

b)

rowcount

c)

count

d)

row_count

17.

Name the method which is used for displaying only one resultset.

a)

fetchmany

b)

fetchno

c)

fetchall

d)

fetchone

18.

To execute all the rows from the result set, which method is used?

a)

fetchmany

b)

fetchno

c)

fetchall

d)

fetchone

19.

The command used for modifying the records is:

a)

update

b)

modify

c)

both

d)

none of these

20.

Pandas deals with following data structures

a)

Series

b)

Series and Data Frames

c)

Series, DataFrames and Panel

d)

None of Above

21.

Best way to import the pandas module in your program ?

a)

1.import pandas

b)

2.import pandas as pd

c)

3.from pandas import *

d)

4.All of the above

22.

DataFrame in pandas is

a)

1. dimensional array

b)

2. dimensional array

c)

3.dimensional array

d)

4.None of the above

23.

Which of the following object you get after reading CSV file?

a)

a) DataFrame

b)

b) Character Vector

c)

c) Panel

d)

d) All of the mentioned

24.

Which of the following library is similar to Pandas?

a)

a) NumPy

b)

b) RPy

c)

c) SciPy

d)

d) None of the mentioned

25.

Which is not a feature of series

a)

Homogeneous data

b)

Immutable size

c)

Mutable data

d)

Multiple rows

26.

Series can be created from

a)

Array

b)

Dictionary

c)

Scaler value

d)

All of them

27.

Series can be created from

a)

Array

b)

Dictionary

c)

Scaler value

d)

All of them

28.

Full form of CSV file is

a)

Comma Separated Vault

b)

Comma Separated Value

c)

Common Separated Value

d)

Common System Value

29.

Not a function of Dataframe

a)

Head()

b)

Tail()

c)

loc()

d)

multi()

30.

Which function from the options given below can read the dataset from a large text file?

a)

read_json

b)

read_pickle

c)

read_hdf

d)

read_csv