Python Quiz Quiz Python Fundamental Quiz 3 Pradip Devkar October 8, 2024 “Welcome to the Python Fundamentals Quiz! Test your basic knowledge of Python programming with these 10 questions. Whether you are just starting out or brushing up on your skills, this quiz will help reinforce key Python concepts. Good luck!” Python Fundamentals Quiz 3 "Welcome to the Python Fundamentals Quiz! Test your basic knowledge of Python programming with these 10 questions. Whether you are just starting out or brushing up on your skills, this quiz will help reinforce key Python concepts. Good luck!" 1 / 10 Which of the following are immutable types in Python? (Select all that apply) Tuple List Set String 2 / 10 Which of the following data types is not built into Python? List Tuple Dictionary Array 3 / 10 What does the len() function return when applied to a dictionary? None The number of key-value pairs The number of keys The length of the longest key 4 / 10 What is the output of the following code?a = {1, 2, 3}b = {3, 4, 5}print(a & b) {1, 2} {3} Error {1, 2, 3, 4, 5} 5 / 10 What is the purpose of the self keyword in Python class methods? It refers to the class itself None of the above It refers to the superclass It refers to the current instance of the class 6 / 10 What is the output of the following code?x = [1, 2, 3, 4]print(x[1:3]) [2, 3] [1, 2, 3] [2, 3, 4] [1, 2] 7 / 10 What is the output of the following code?x = [10, 20, 30]x[1:1] = [15]print(x) [10, 20, 30] [10, 15, 20, 30] Error [10, 15, 30] 8 / 10 What is the correct syntax for a list comprehension that creates a list of squares of numbers from 0 to 9? (x**2 for x in range(9)) [x**2 for x in range(9)] {x**2 for x in range(10)} [x**2 for x in range(10)] 9 / 10 What will be the output of the following code?a = {1, 2, 3}a.add([4, 5])print(a) {1, 2, 3, [4, 5]} {1, 2, 3, 4, 5} Error None of given options 10 / 10 What will be the output of this code?my_list = ['apple', 'banana', 'cherry']print(my_list[-1]) Error apple banana cherry Your score isThe average score is 50% 0% Restart quiz Share this… Whatsapp Linkedin Facebook Twitter Gmail Related Continue Reading Previous Python Fundamental Quiz 4Next Python Fundamental Quiz 2 More Stories Gen AI Quiz Quiz Gen Ai Expert Quiz 10 Pradip Devkar December 26, 2024 Gen AI Quiz Quiz Gen Ai Expert Quiz 9 Pradip Devkar December 26, 2024 Gen AI Quiz Quiz Gen Ai Advanced Quiz 8 Pradip Devkar December 20, 2024 Leave a Reply Cancel replyYou must be logged in to post a comment.