1. Home
  2. Data Science
  3. Python
  4. What does random.randint(1, 6) return in Python?

Added 25 Nov 2026

What does random.randint(1, 6) return in Python?

  1. A float between 1 and 6
  2. An integer from 1 to 5
  3. An integer from 1 to 6 inclusive Correct answer
  4. A list

Correct answer

C. An integer from 1 to 6 inclusive

5 views

MCQSEXAM

Explanation

randint includes both endpoints.

Reference

Asked in: Python Interview Advanced Python

https://docs.python.org/3/library/index.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs