Questions Bank November 5, 2022 Comments Off on Questions Bank Questions Bank › Category: Python Essentials 1Take a look at the snippet, and choose the true statements: (Select two answers) nums = [1, 2, 3] vals = nums del vals[1:2]OpenProgrammingAnswers asked 2 years ago • Python Essentials 1After execution of the following snippet, the sum of all vals elements will be equal to: vals = [0, 1, 2] vals.insert(0, 1) del vals[1]OpenProgrammingAnswers asked 2 years ago • Python Essentials 1The second assignment: vals = [0, 1, 2] vals[0], vals[2] = vals[2], vals[0]OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following snippet? my_list = [1, 2, 3, 4] print(my_list[-3:-2])OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following snippet? my_list = [3, 1, -2] print(my_list[my_list[-1]])OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following snippet? a = 1 b = 0 c = a & b d = a | b e = a ^ b print(c + d + e)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What value will be assigned to the x variable? z = 10 y = 0 x = y < z and z > y or y > z and z < yOpenProgrammingAnswers asked 2 years ago • Python Essentials 1How many hashes (#) will the following snippet send to the console? var = 1 while var < 10: print("#") var = var << 1OpenProgrammingAnswers asked 2 years ago • Python Essentials 1How many hashes (#) will the following snippet send to the console? var = 0 while var < 6: var += 1 if var % 2 == 0: continue print("#")OpenProgrammingAnswers asked 2 years ago • Python Essentials 1How many hashes (#) will the following snippet send to the console? for i in range(1): print(“#”) else: print(“#”)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1How many stars (*) will the following snippet send to the console? i = 0 while i <= 5 : i += 1 if i % 2 == 0: break print("*")OpenProgrammingAnswers asked 2 years ago • Python Essentials 1How many stars (*) will the following snippet send to the console? i = 0 while i <= 3 : i += 2 print("*")OpenProgrammingAnswers asked 2 years ago • Python Essentials 1The value eventually assigned to x is equal to: x = 1 x = x == xOpenProgrammingAnswers asked 2 years ago • Python Essentials 1An operator able to check whether two values are equal is coded as:OpenProgrammingAnswers asked 2 years ago • Python Essentials 1What is the output of the following snippet if the user enters two lines containing 2 and 4 respectively? x = int(input()) y = int(input()) print(x + y)OpenProgrammingAnswers asked 2 years ago • Python Essentials 1 Share Facebook Twitter Stumbleupon LinkedIn Pinterest