MCQ Answer

<p>What will be the output of the following Python function if the random module has already been imported?</p> <pre><span style="font-size: 14px;">import random<br></span><span style="font-size: 14px;">print(random.randint(3.5,7))</span></pre><div><br></div>

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

import random
print(random.randint(3.5,7))



यदि रैंडम मॉड्यूल पहले से ही इम्पोर्ट किया गया है तो निम्न पायथन फ़ंक्शन का आउटपुट क्या होगा?

import random
print(random.randint(3.5,7))
Topic : Modules in Python

A. Error एरर

B. Any integer between 3.5 and 7, including 7 3.5 और 7 के बीच कोई भी पूर्णांक, जिसमें 7 भी शामिल हैं

C. Any integer between 3.5 and 7, excluding 7 3.5 और 7 के बीच कोई भी पूर्णांक, 7 को छोड़कर

D. The integer closest to the mean of 3.5 and 7 पूर्णांक 3.5 और 7 के माध्य से निकटतम है




Correct Answer is :

A. Error



Explanation
The function random.randint() does not accept a decimal value as a parameter. Hence the function shown above will throw an error.
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