Question
Boss, here's the continuation. Kindly answer it please... @ Ronald, I appreciate you effort. Thanks again. 11. Which of the following statements is false? a.)
Boss, here's the continuation. Kindly answer it please... @ Ronald, I appreciate you effort. Thanks again.
11. Which of the following statements is false?
a.) The None value cannot be used as an argument of arithmetic operators b.) The None value can be compared with variables c.) The None value may not be used outside functions d.) The None value can be assigned to variables
12. What is the output of the following snippet?
def fun(x): if x % 2 == 0: return 1 else: return print(fun(fun(2)) + 1)
a.) 1 b.) 2 c.) None d.) the code will cause a runtime error
13. What is the output of the following snippet?
def fun(x): global y y = x * x return y fun(2) print(y)
a.) 4 b.) the code will cause a runtime error c.) 2 d.) None
14. What is the output of the following snippet?
def any(): print(var + 1,end='') var = 1 any() print(var) a.) 22 b.) 12 c.) 11 d.) 21
15.Assuming that tuple is a correctly created tuple, the fact that tuples are immutable means that the following instruction:
tuple[1] = tuple[1] + tuple[0]
a.) is illegal b.) is fully correct c.) can be executed if and only if the tuple contains at least two elements d.) may be illegal if the tuple contains strings
16. What is the output of the following snippet?
list = ['Mary', 'had', 'a', 'little', 'lamb'] def list(L): del L[3] L[3] = 'ram' print(list(list))
a.) ['Mary', 'had', 'a', 'lamb'] b.) ['Mary', 'had', 'a', 'little', 'lamb'] c.) the snippet is erroneous d.) ['Mary', 'had', 'a', 'ram']
17. What is the output of the following snippet?
def fun(x,y,z): return x+2*y+3*z print(fun(0,z=1,y=3)) a.) 0 b.) 9 c.) 3 d.) the snippet is erroneous
18. What is the output of the following snippet?
def fun(inp=2,out=3): return inp * out print(fun(out=2))
a.) the snippet is erroneous b.) 4 c.) 2 d.) 6
19. What is the output of the following snippet?
dct = { 'one':'two', 'three':'one', 'two':'three' } v = dct['one'] for k in range(len(dct)): v = dct[v] print(v)
a.) two b.) three c.) one d.) ('one', 'two', 'three')
20. What is the output of the following snippet?
tup = (1, 2, 4, 8) tup = tup[1:-1] tup = tup[0] print(tup)
a.) the snippet is erroneous b.) 2 c.) (2) d.) (2,)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started