random function Quiz 1

Share with others

Enter details and click on Next

Email
Q1. Write the output of the following code :

import randomfor i in range(random.randint(2,2)):         print(i)

Q2. Write the output of the following code :

import randomfor i in range(random.randint(2,3)):         print("A")

Q3. What is the minimum and maximum value of 'A' in the following statement..

import randomA=random.randint(2,30)print(A)

Q4. Write the output of the following code :

import randomA=random.randrange(20)print(A)

Q5. Write the output of the following code :

import randomprint(int(random.random()))

Q6. Write the output of the following code :

import randomprint(int(random.random()*5))

Q7. Which of the following subject will never printed in following code?

import randomL=["English","Hindi","Math","Science","SST","CS","IP"]for i in range(random.randint(1,6)):       print(L[i])

Q8. What is the minimum and maximum value of 'v' in the following statement.

import randomv=random.randrange(20)-3print(v)

Q9. Which of the following method is not included in random module?

Q10. A = random.______([1,2,3,4,5])

Value of A can be 1 to 5(including both)

Share with others
error: Content is protected !!