Report Bug

Qus

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

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

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


A. Error
B. Any integer between 3.5 and 7, including 7
C. Any integer between 3.5 and 7, excluding 7
D. The integer closest to the mean of 3.5 and 7


Solution
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.
CCC Online Test 2021 CCC Practice Test Hindi 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