Computer Science and Entrepreneurship Python Programming Built-in Data Structures Medium Q1. What makes a tuple different from a list in Python? Tuples are slower Tuples use curly brackets Tuples are immutable
Computer Science and Entrepreneurship Python Programming Built-in Data Structures Medium Q2. Which list method can combine two lists together? combine() extend() merge() join()
Computer Science and Entrepreneurship Python Programming Built-in Data Structures Medium Q3. What is the output of numbers = [1,2,3,4,5]; print(numbers[1:4])? [1,2,3] [2,3] [2,3,4] [1,2,3,4]
Computer Science and Entrepreneurship Python Programming Built-in Data Structures Medium Q4. Which method is used to remove the first matching item from a list? delete() pop() remove() cut()
Computer Science and Entrepreneurship Python Programming Built-in Data Structures Medium Q5. What will be the output? fruits=['Mango', 'Apple', 'Banana']; fruits[0]='Orange'; print(fruits) ['Mango', 'Apple', 'Banana'] ['Orange', 'Apple', 'Banana'] ['Mango', 'Banana', 'Apple'] ['Orange', 'Mango', 'Apple', 'Banana']
Computer Science and Entrepreneurship Python Programming Built-in Data Structures Medium Q6. What does the append method do in a list? Deletes an item Sorts the list Adds an item to the end Inserts an item at the beginning
Computer Science and Entrepreneurship Python Programming Built-in Data Structures Medium Q7. How do you access the second item in a list called fruits? fruits[2] fruits[1] fruits(2) fruits{2}
Computer Science and Entrepreneurship Python Programming Built-in Data Structures Medium Q8. Which of the following is NOT a built-in data structure in Python? List Tuple Integer Dictionary
Computer Science and Entrepreneurship Python Programming Python Modules and Built-in Data Structures Medium Q9. Which of the following is a built-in Python library used to generate random numbers? math datetime random os
Computer Science and Entrepreneurship Python Programming Python Modules and Built-in Data Structures Medium Q10. What is the purpose of a default parameter in a function? Speed up the function Skip return values Use a value if none is given Cause an error if empty