Computer Science
Assertion (A): Some of the real-life applications of random module include CAPTCHA, OTP generation, automatic password generator and auto-filling, etc.
Reasoning (R): To import a random module, use:
import random
from random import*
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Python Modules
2 Likes
Answer
Both A and R are true but R is not the correct explanation of A.
Explanation
The random module is used in various real-life applications like CAPTCHA, OTP generation, automatic password generation, and auto-filling forms. The statement to import random module is
import random
from random import *
Answered By
2 Likes
Related Questions
Assertion (A): The randint() method returns an integer from the specified range.
Reasoning (R): The syntax for randint() is:
random.randint (start:stop)- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Assertion (A): The function ceil() is a commonly used function from math module.
Reasoning (R): The ceil() function takes a numeric argument and returns the smallest integer that is greater than or equal to the argument.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Assertion (A): The median() method returns the middle value of numeric data in a list.
Reasoning (R): The math module contains both mathematical and statistical functions.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Assertion (A): Python has a built-in math module that you can use for mathematical tasks.
Reasoning (R): The mean() method calculates the arithmetic mean of the numbers in a list using math module.
- Both A and R are true and R is the correct explanation of A.
- Both A and R are true but R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.