NEW
Font size
WorksheetsLesson 34 - Math & OS module
Total questions: 12
Worksheet time: 6mins
Random module is which type of module ?
External
inbuilt
both
none
The function in random used to generate random number within a range and step is ?
randint()
randrange()
random()
all of the above
What will be the output of the following code ?
L=[1,2,3,4,5]
random.shuffle(L)
print(L)
[1,2,3,4,6]
[6,2,5,4,1]
[4,3,5,2,1]
none
he function in OS module to generate current working directory ?
getcwd
getdir()
cwd()
none
The function in OS module to change the current working directory ?
chgdir()
chdir()
changedirectory()
none
The module which makes some system changes is -
random
os
datetime
none
Which function is used to find squareroot of the given number in math module ?
sqrt()
root()
squareroot()
none
Which one of the following is external python module ?
random
os
numpy
datetime
The function in math module to find any power of the number ?
power()
pow()
exp()
none
What will be the output of the following code ?
L=[1,2,3,4,5]
S=math.fsum(L)
print(S)
[1,2,3,4,5]
120
15
none
The module used for doing the system related tasks is ?
os
datetime
numpy
random
Which function in math module used for finding the greatest common divisor?
gcd()
GCD()
fun()
none
