Computer Science
Related Questions
Write a function Push() which takes number as argument and add in a stack "MyValue".
Write the output of the following code:
for i in range(5): print(i)Assertion (A): Program should check for Overflow condition before executing Push operation on stack and similarly check for Underflow condition before executing Pop operation.
Reasoning (R): In stack, Underflow condition signifies that there is no element available in the stack while Overflow condition means no further element can be pushed in the stack.
- 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): ('x' and 'y' or not 7) is a valid expression in Python.
Reason (R): In Python, strings and numbers can be treated as Boolean values.
- 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.