wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Lesson 34 - Math & OS module

Total questions: 12

Worksheet time: 6mins

Name
Class
Date
1.

Random module is which type of module ?

a)

External

b)

inbuilt

c)

both

d)

none

2.

The function in random used to generate random number within a range and step is ?

a)

randint()

b)

randrange()

c)

random()

d)

all of the above

3.

What will be the output of the following code ?

L=[1,2,3,4,5]

random.shuffle(L)

print(L)

a)

[1,2,3,4,6]

b)

[6,2,5,4,1]

c)

[4,3,5,2,1]

d)

none

4.

he function in OS module to generate current working directory ?

a)

getcwd

b)

getdir()

c)

cwd()

d)

none

5.

The function in OS module to change the current working directory ?

a)

chgdir()

b)

chdir()

c)

changedirectory()

d)

none

6.

The module which makes some system changes is -

a)

random

b)

os

c)

datetime

d)

none

7.

Which function is used to find squareroot of the given number in math module ?

a)

sqrt()

b)

root()

c)

squareroot()

d)

none

8.

Which one of the following is external python module ?

a)

random

b)

os

c)

numpy

d)

datetime

9.

The function in math module to find any power of the number ?

a)

power()

b)

pow()

c)

exp()

d)

none

10.

What will be the output of the following code ?

L=[1,2,3,4,5]

S=math.fsum(L)

print(S)

a)

[1,2,3,4,5]

b)

120

c)

15

d)

none

11.

The module used for doing the system related tasks is ?

a)

os

b)

datetime

c)

numpy

d)

random

12.

Which function in math module used for finding the greatest common divisor?

a)

gcd()

b)

GCD()

c)

fun()

d)

none