1. What will be the output of following program after the execution of the following code? x = 0 y = 0 if x > 0:       y = y + 1 else:        if x                y = y + 2 else:           y = y + 5...

1. What will be the output of following program after the execution of the following code?

x = 0


y = 0


if x > 0:


      y = y + 1


else:


       if x <>


               y = y + 2


else:


          y = y + 5


print(‘ Y =’,y)


a. 1            b. 0


c. 2            d. 5


B. What will be stored in num after the execution of the following code?


i=10


j=20


k=30


if j>k:


      if i > j:


             num = i


else:


        num = j


else:


       if i > k:


               num = i


else:


         num = k


print(‘Num = ‘,num)


a. 10         b. 20


c. 30          d. None of the above


C. Which of the following Python logical expressions can determine whether x and y are greater than z?


a. x & y > z               b. (x > z) &(y > z)


c. (y > z) & (x > y)    d. Both b and c


e. All of the above


D. Evaluate the following Python expression and tell the value in terms of true and false.


a. i=5


    j=10


    k=15


   print(i == k / j)




b. i=5


    k=15


    print( k % i <>


May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here