Assignment-EXTRA QUESTIONS
Assignment-EXTRA QUESTIONS
“In a Python program, if a break statement is given in a nested loop, it terminates the execution of all loops in one
go.”
print(3-2**2**3+99/11)
Options:
4. Which of the following will delete key-value pair for key = “Red” from a dictionary D1?
5. Consider the statements given below and then choose the correct output from the given options:
pride="#G20 Presidency"
print(pride[-2:2:-2])
6. Which of the following statement(s) would give an error during execution of the following code?
tup = (20,30,40,50,80,79)
print(tup) #Statement 1
print(tup[3]+50) #Statement 2
print(max(tup)) #Statement 3
tup[4]=80 #Statement 4
7. What possible outputs(s) will be obtained when the following code is executed?
Options:
a. b. c. d.
Which of the following statements should be given in the blank for #Missing Statement, if the output produced is
110?
Q10 and 11 are ASSERTION AND REASONING based questions. Mark the correct choice as
(a) Both A and R are true and R is the correct explanation for A
(b)Both A and R are true and R is not the correct explanation for A
Reasoning(R): When an attempt is made to update the value of an immutable variable, the old variable is destroyed
and a new variable is created by the same name in memory.
Reasoning(R): A function in a module is used to simplify the code and avoids repetition.