Vidyalelo
Python · all questions

Module in Python
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

189

Questions

10/10

Page

Pick an option on a question to see the right answer and solution.

What is the value of x if x = math.sqrt(4)?

Select an option to see the answer and solution.

State whether true or false.
s = time.time()
t= time.time()
s == t

Select an option to see the answer and solution.

What is math.floor(0o10)?

Select an option to see the answer and solution.

What will be the output of the following code:
import random
print(random.choice([1, 2, 3, 4]))

Select an option to see the answer and solution.

Which of the following functions can be used to find the coordinated universal time, assuming that the datetime module has already been imported?

Select an option to see the answer and solution.

Which type of elements are accepted by random.shuffle()?

Select an option to see the answer and solution.

What will be the output of the following Python function, assuming that the random library has already been included?
random.shuffle[1,2,24]

Select an option to see the answer and solution.

Which of the following will throw an error if used after the following Python code?
tday=datetime.date.today()
bday=datetime.date(2017,9,18)
t_day=bday-tday

Select an option to see the answer and solution.

What does os.close(f) do?

Select an option to see the answer and solution.