Random Module

Qus. 1 : <p>What will be the output of the following Python expression?</p> <pre><span class="kw2" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" green;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">print(round</span><span class="br0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">(</span><span class="nu0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" color:="" rgb(255,="" 69,="" 0);="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">4.576</span><span class="br0" style="font-family: Consolas, Monaco, " lucida="" console",="" monospace;="" text-align:="" justify;="" overflow:="" visible;="" padding:="" 0px;="" border:="" box-shadow:="" none;="" background-image:="" initial;="" background-position:="" background-size:="" background-repeat:="" background-attachment:="" background-origin:="" background-clip:="" overflow-wrap:="" normal;="" margin:="" 0px="" !important;="" line-height:="" 20px="" !important;"="">))</span></pre>

  1. 4.5
  2. 5
  3. 4
  4. 4.6
Qus. 2 : <p>What will be the output of the following Python function, assuming that the random module has already been imported?</p> <pre><span style="font-size: 14px;">import random<br></span><span style="font-size: 14px;">random.uniform(3,4)</span></pre>

  1. Error
  2. Either 3 or 4
  3. Any integer other than 3 and 4
  4. Any decimal value between 3 and 4
Qus. 3 : <p>What will be the output of the following Python code?</p> <pre><span style="font-size: 12.6px;">import random print(random.randrange(0,91,5))</span> </pre><div><br></div>

  1. 10
  2. 18
  3. 79
  4. 95
Qus. 4 : <p>Which can be the output of the following Python code?</p> <pre><span style="font-size: 14px;">import random<br></span><span style="font-size: 14px;">print(random.randrange(1,100,10))</span></pre>

  1. 32
  2. 67
  3. 91
  4. 80
Qus. 5 : random.shuffle() function shuffle value of

  1. take a sequence, like a list, and arrange the items in ascending order
  2. take a sequence, like a list, and reorganize the order of the items.
  3. take a sequence, like a list, and arrange the items in descending
  4. take a sequence, like a list, and return the same copy of sequence

Programs

python program to generate 3 random integers between 100 and 999 which is divisible by 5

View Solution


python program to generate 6 digit random secure OTP between 100000 to 999999

View Solution


python program to generate 6 random numbers and then print their mean median and mode

View Solution


python program to print the calendar of given month and year

View Solution


python program to print the calendar of given year

View Solution


Latest Current Affairs 2024 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Online MBA 2 years Online MCA Online BCA Best Website and Software Company in Allahabad