Questions Bank November 5, 2022 Comments Off on Questions Bank Questions Bank › Category: Python Essentials 1The following snippet: def function_1(a): return None def function_2(a): return function_1(a) * function_1(a) print(function_2(2))OpenProgrammingAnswers asked 2 years ago • Python Essentials 1An operator able to check whether two values are not equal is coded as:OpenProgrammingAnswers asked 2 years ago • Python Essentials 1Which of the following sentences are true about the code? (Select two answers) nums = [1, 2, 3] vals = numsOpenProgrammingAnswers asked 2 years ago • Python Essentials 1The meaning of a positional argument is determined by:OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following snippet? my_list = [1, 2] for v in range(2): my_list.insert(-1, my_list[v]) print(my_list)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following code? try: value = input(“Enter a value: “) print(value/value) except ValueError: print(“Bad input…”) except ZeroDivisionError: print(“Very bad input…”) except TypeError: print(“Very very bad input…”) except: print(“Booo!”)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1Select the true statements about the try-except block in relation to the following example. (Select two answers.) try: # Some code is here… except: # Some code is here…OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following code? tup = (1, 2, 4, 8) tup = tup[1:-1] tup = tup[0] print(tup)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following code? dictionary = {‘one’: ‘two’, ‘three’: ‘one’, ‘two’: ‘three’} v = dictionary[‘one’] for k in range(len(dictionary)): v = dictionary[v] print(v)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What 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))OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following snippet? my_list = [‘Mary’, ‘had’, ‘a’, ‘little’, ‘lamb’] def my_list(my_list): del my_list[3] my_list[3] = ‘ram’ print(my_list(my_list))OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following snippet? def any(): print(var + 1, end=”) var = 1 any() print(var)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following snippet? def fun(x): global y y = x * x return y fun(2) print(y)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following snippet? def fun(x): if x % 2 == 0: return 1 else: return print(fun(fun(2)) + 1)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1Which of the following statements are true? (Select two answers)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1 Share Facebook Twitter Stumbleupon LinkedIn Pinterest