Questions Bank November 5, 2022 Comments Off on Questions Bank Questions Bank › Category: Python Essentials 1What is the output of the following piece of code if the user enters two lines containing 2 and 4 respectively? x = float(input()) y = float(input()) print(y ** (1 / x))OpenProgrammingAnswers asked 2 years ago • Python Essentials 1Assuming that my_tuple is a correctly created tuple, the fact that tuples are immutable means that the following instruction: my_tuple[1] = my_tuple[1] + my_tuple[0]OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following piece of code? x = 1 // 5 + 1 / 5 print(x)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following piece of code? print(“a”, “b”, “c”, sep=”sep”)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following piece of code if the user enters two lines containing 3 and 6 respectively? y = input() x = input() print(x + y)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following piece of code if the user enters two lines containing 3 and 2 respectively? x = int(input()) y = int(input()) x = x % y x = x % y y = y % x print(y)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1Take a look at the snippet and choose the true statement: nums = [1, 2, 3] vals = nums del vals[:]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 2 print(fun(fun(2)))OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What will be the output of the following snippet? a = 1 b = 0 a = a ^ b b = a ^ b a = a ^ b print(a, b)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following piece of code? x = 1 y = 2 x, y, z = x, x, y z, y, z = x, y, z print(x, y, z)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following snippet? my_list = [x * x for x in range(5)] def fun(lst): del lst[lst[2]] return lst print(fun(my_list))OpenProgrammingAnswers asked 2 years ago • Python Essentials 1Which of the following variable names are illegal and will cause the SyntaxError exception? (Select two answers)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What value will be assigned to the x variable? z = 0 y = 10 x = y < z and z > y or y < z and z < yOpenProgrammingAnswers asked 2 years ago • Python Essentials 1The following snippet: def func(a, b): return b ** a print(func(b=2, 2))OpenProgrammingAnswers asked 2 years ago • Python Essentials 1The result of the following division: 1 // 2OpenProgrammingAnswers asked 2 years ago • Python Essentials 1 Share Facebook Twitter Stumbleupon LinkedIn Pinterest