Assertion(A): A boolean is a data type that can store only two values: True or False
Reasoning(R): A boolean can be created by using the keywords True or False or by applying logical operators on other values
Answer:
Answer by student
(a) Both A and R are true and R is the correct explanation for A
Detailed answer by teachoo
-lock-
The correct choice is (a) Both A and R are true and R is the correct explanation for A. This is because both the assertion and the reasoning are true statements about boolean data type, and the reasoning correctly explains how to create a boolean value in Python.
A boolean is a data type that can store only two values: True or False , which are used to represent the truth value of a condition or expression. For example, you can write x = True or y = False to assign boolean values to variables.
A boolean can also be created by using the keywords True or False or by applying logical operators on other values, such as and , or , not , == , != , < , > , etc. For example, you can write z = x and y or w = 10 > 5 to create boolean values from other values.
The reason why a boolean can store only two values is because it is based on the concept of binary logic, where any statement can be either true or false.
So, the correct answer is (a) Both A and R are true and R is the correct explanation for A.
-endlock-