# Module quiz: Basic Programming with Python - Module 2

1. **Which of the following is not a sequence data-type in Python?**
    
    * <mark>Dictionary</mark>
        
    * List
        
    * Tuples
        
    * String
        
2. **For a given list called new\_list, which of the following options will work:**
    
    `new_list = [1,2,3,4]`
    
    *Select all that apply.*
    
    * new\_list\[4\] = 10
        
    * <mark>new_list.extend(new_list)</mark>
        
    * <mark>new_list.insert(0, 0)</mark>
        
    * <mark>new_list.append(5)</mark>
        
3. **Which of the following is not a type of variable scope in Python?**
    
    * Local
        
    * Global
        
    * Enclosing
        
    * <mark>Package</mark>
        
4. **Which of the following is a built-in data structure in Python?**
    
    * Queue
        
    * <mark>Set</mark>
        
    * LinkedList
        
    * Tree
        
5. **For a given file called ‘names.txt’, which of the following is NOT a valid syntax for opening a file:**
    
    * with open('names.txt', 'r') as file:
        
        print(type(file))
        
    * with open('names.txt', 'w') as file:
        
        print(type(file))
        
    * with open('names.txt', 'rb') as file:
        
        print(type(file))
        
    * <mark>with open('names.txt', 'rw') as file:</mark>
        
        <mark>print(type(file))</mark>
        
6. **Which among the following is not a valid Exception in Python?**
    
    * <mark>ZeroDivisionException</mark>
        
    * FileNotFoundError
        
    * IndexError
        
    * LoopError
        
7. **For a file called name.txt containing the lines below:**
    
    ```plaintext
    First line
    Second line
    And another !
    ```
    
    **What will be the output of the following code:**
    
    ```python
    print(lines)
    with open('names.txt', 'r') as file:
    lines = file.readlines()
    ```
    
    * 'First line'
        
    * <mark>[‘First line\n’,</mark>
        
        <mark>‘Second line\n’,</mark>
        
        <mark>‘And another !’]</mark>
        
    * \['First line'\]
        
    * 'First line'
        
        'Second line'
        
        'And another !'
        
8. **State *TRUE* or *FALSE*:**
    
    **\*args passed to the functions can accept the key-value pair.**
    
    * True
        
    * <mark>False</mark>
        

---

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1731051906078/90a802e7-b771-499d-abbf-e30e732af7a6.png align="center")
