Home » Python Essentials Quiz » VITyarthi Python Essentials Module 7 Quiz Answer VITyarthi Python Essentials Module 7 Quiz Answer June 4, 2023May 13, 2023 by Amit Gunjan Jha Table of Contents Toggle Question 1Question 2Question 3Question 4Question 5Question 6Question 7Question 8Question 9Question 10Question 11Question 12Question 13Question 14 Question 1 Let list1 =[1,2,3,4,5,6]. How to access the last element?list1[-1]list1[5]BothNone Answer list1[-1] Question 2 Let list1 =[1,2,3,4,5,6]. What is the output of list1[:2] Answer [1, 2] Question 3 Let list1 =[1,2,3,4,5,6]. What is the output of list1[-4:-1] Answer [3, 4, 5] Question 4 A Tuple is immutable: Say True or FalseTrueFalse Answer True Question 5 Which are all applicable statements to tuple data structure?We can’t add/delete elements to/from a tupleTuples are faster than lists.Tuples are useful for secured data transfer.All the above Answer 3. All the above Question 6 What will be the output of the following Python code? t=(10,20,40,30) print(t[1:-1]) Answer [20, 40] Question 7 What will be the output of the following Python code? t = (10, 20) 2 * t Answer (10, 20, 10, 20) Question 8 Will the given Python code get executed? trial = (10, 20, 30, 40) trial.append( (5, 6, 7) ) print(len(trial))TrueFalse Answer 2. False Question 9 1. Which of these about a set is not true?Mutable data typeAllows duplicate valuesData type with unordered valuesImmutable data type Answer 4. Immutable data type Question 10 Which of the following is not the correct syntax for creating a set?set([[10,20],[30,40]])set([10,20,20,30,40])set((10,20,30,40)){10,20,30,40} Answer set([[10,20],[30,40]]) Question 11 Which of the following statements is used to create an empty set?{ }set()[ ]( ) Answer 2. set() Question 12 Which of the following command is used to find the number of entries in the given dictionary? dic = {“course”:”Python”, “year”:2021}dic.size()len(dic)size(dic)dic.len() Answer 2. len(dic) Question 13 Which one of the following is correct?In Python, a dictionary can have two same keys with different values.In Python, a dictionary can have two same values with different keysIn Python, a dictionary can have two same keys or same values but cannot have two same key-value pairIn python, a dictionary can neither have two same keys nor two same values. Answer 3. In Python, a dictionary can have two same keys or same values but cannot have two same key-value pair Question 14 Which of these about a frozenset is not true?Mutable data typeAllows duplicate valuesData type with unordered valuesImmutable data type Answer Mutable data type If you find anything wrong in this Answer Key, feel free to reach us in the comment section. Sharing Is Caring: