1. Home
  2. Data Science
  3. Python
  4. Which module is used for secure random tokens and…

Added 25 Nov 2026

Which module is used for secure random tokens and passwords in Python?

  1. random
  2. tokens
  3. secrets Correct answer
  4. crypto

Correct answer

C. secrets

5 views

MCQSEXAM

Explanation

secrets uses a cryptographically strong source; random is not for security.

Reference

Asked in: Python Interview Standard Library

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