MCQ Single Best Answer Not Set

QWhat will be the output after the following statements?
import random
x = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday',
'Saturday', 'Sunday']
print(x[random.randint(0, len(x) - 1)])

ID: #3996 Python Random Module MCQ 384 views
Question Info
#3996Q ID
Not SetDifficulty
Python Random Module MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A IndexError
  • B A random day from all the seven days
  • C A random day from all the days except Sunday
  • D A random day from all the days except Monday
Correct Answer: Option B

Explanation

A random day from all the seven days

Share This Question

Challenge a friend or share with your study group.