adplus-dvertising
frame-decoration

Question

Which of the following is equivalent to random.randint(3, 6)?

a.

random.choice([3, 6])

b.

random.randrange(3, 6)

c.

3 + random.randrange(3)

d.

3 + random.randrange(4)

Posted under Python

Answer: (d).3 + random.randrange(4)

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Which of the following is equivalent to random.randint(3, 6)?

Similar Questions

Discover Related MCQs

Q. Which of the following will not be returned by random.choice(“1 ,”)?

Q. Which of the following will never be displayed on executing print(random.choice({0: 1, 2: 3}))?

Q. What does random.shuffle(x) do when x = [1, 2, 3]?

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

Q. What is the range of values that random.random() can return?

Q. Which of the following functions can help us to find the version of python that we are currently working on?

Q. Which of the following functions is not defined under the sys module?

Q. The output of the functions len(“abc”) and sys.getsizeof(“abc”) will be the same. State whether true or false.

Q. What does os.name contain?

Q. What does print(os.geteuid()) print?

Q. What does os.getlogin() return?

Q. What does os.close(f) do?

Q. What does os.fchmod(fd, mode) do?

Q. Which of the following functions can be used to read data from a file using a file descriptor?

Q. Which of the following returns a string that represents the present working directory?

Q. What does os.link() do?

Q. Which of the following can be used to create a directory?

Q. Which of the following can be used to create a symbolic link?

Q. The command which helps us to reset the pen (turtle):

Q. Which of the following functions can be used to make the arrow black?