A. What will be the output of the following code fragment assuming num is 10? num=10 if num == 20:         print(‘Apple’)        print(‘Grapes’)        print(‘No Output’) a. Apple                 b....

A. What will be the output of the following code fragment assuming num is 10?

num=10


if num == 20:


        print(‘Apple’)


       print(‘Grapes’)


       print(‘No Output’)


a. Apple                 b. Grapes


c. Apple Grapes    d. No Output


B.What will be the output of the following program?


P=int(True)


q=int(False)


print(‘P = ‘,p)


print(‘q = ‘,q)


a. Error                        b. p=0 q=1


c. p=True q=False       d. p = 1 and q = 0


C. Evaluate the following Boolean expressions. Consider the value of P, Q and R as 4, 5 and 6, respectively.


a. P > 7                     b. P <> 2


c. P == 1                   d. P > 2 || Q > 6


D. What will be the output of the following program if the value stored in variable num is 19?


if num % 2 == 1:


print(num,’ is odd number’)


print(num,’ is even number ‘)




May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here