MCQ Answer

<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>

What will be the output of the following Python function, assuming that the random module has already been imported?

import random
random.uniform(3,4)


निम्नलिखित Python फ़ंक्शन का आउटपुट क्या होगा, यह मानते हुए कि रैंडम मॉड्यूल पहले ही इम्पोर्ट किया जा चुका है?

import random
random.uniform(3,4)
Topic : Modules in Python

A. Error एरर

B. Either 3 or 4

C. Any integer other than 3 and 4 3 और 4 के अलावा कोई भी इन्टिजर

D. Any decimal value between 3 and 4 3 और 4 के बीच कोई भी डेसिमल वैल्यू




Correct Answer is :

D. Any decimal value between 3 and 4



Explanation
This question depicts the basic difference between the functions random.randint(a, b) and random.uniform(a, b). While random.randint(a,b) generates an integer between ‘a’ and ‘b’, including ‘a’ and ‘b’, the function random.uniform(a,b) generates a decimal value between ‘a’ and ‘b’.
Latest Current Affairs 2025 Online Exam Quiz for One day Exam Online Typing Test CCC Online Test 2025 Python Programming Tutorials Best Computer Training Institute in Prayagraj (Allahabad) Best Java Training Institute in Prayagraj (Allahabad) Best Python Training Institute in Prayagraj (Allahabad) O Level Online Test in Hindi Bank SSC Railway TET UPTET Question Bank career counselling in allahabad Sarkari Naukari Notification Best Website and Software Company in Allahabad Sarkari Exam Quiz