<jupyter_start><jupyter_text>Before you turn this problem in, make sure everything runs as expected. First, **restart the kernel** (in the menubar, select Kernel$\rightarrow$Restart) and then **run all cells** (in the menubar, select Cell$\rightarrow$Run All).Make sure you fill in any place that says `YOUR CODE HERE` or "YOUR ANSWER HERE", as well as your name and collaborators below:<jupyter_code>NAME = ""
COLLABORATORS = ""<jupyter_output><empty_output><jupyter_text>--- For this problem set, we'll be getting used to the Jupyter notebook:![](jupyter.png)The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and narrative text. We will use it to run Python code.The goal of each notebook is to answer a set of questions by implementing code in the specified function. Your implementation should then pass the following locked cell with unit tests.To execute a cell, `CTRL + ENTER` when selected. Other shortcuts are available in the `Cell...` tab.  Prerequisites<jupyter_code># try to edit and execute me :)

print('Hello world !')<jupyter_output><empty_output><jupyter_text>--- Warm upIn this part, we solve very simple Python exercises to warm up. QuestionReturn the sum of two numbers.**Hint** : Before each cell with a function you need to implement, we provide you with an empty cell for you to test ideas.<jupyter_code>def sum(a, b):
    """
    Return a + b
    """
    # YOUR CODE HERE
    raise NotImplementedError()
"""
This is an autograded cell. When you execute this cell with your implementation, it should not return any assert errors.
You are being graded by the number of correct unit tests you pass in those cells. 
From my side, we also test your code on private hidden tests so don't try to just solve public ones :).
We also provide you with the score you can get per cell.

1 point
"""
assert sum(1, 2) == 3<jupyter_output><empty_output><jupyter_text>QuestionSquare all numbers in a list with a list comprehension.The following is a list comprehension :```python>> numbers = [1, 2, 3]>> [x * 2 for x in numbers][2, 4, 6]```<jupyter_code>def squared(numbers):
    """
    Given a list of numbers, return a list of all those numbers, squared.
    """
    # YOUR CODE HERE
    raise NotImplementedError()
"""
Graded cell

1 point
"""
assert squared([2, 4, 6]) == [4, 16, 36]<jupyter_output><empty_output><jupyter_text>QuestionImplement an algorithm to determine if a list of numbers has all unique numbers, that is each element appears exactly once inside it.<jupyter_code>def is_unique(numbers):
    """
    Return True if list of numbers contains only unique numbers, False otherwise.
    """
    # Here, I will help a bit, use a dictionary to store encountered numbers.
    encountered = {}
    encountered[3] = 1
    for number in numbers:
        if number in encountered:
            encountered[3] += 1
    # YOUR CODE HERE
    raise NotImplementedError()
"""
Graded cell

1 point
"""
assert is_unique([2, 5, 9, 7])
assert not is_unique([2, 5, 5, 7])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08778135048231511, 'fraction_numerical': 0.010610932475884245, 'mean_word_length': 4.2998296422487225, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '187042', 'license': 'MIT', 'n_tokens_mistral': 921, 'n_tokens_neox': 877, 'n_words': 419, 'path': 'Spark/PySpark/0.1 Tutorials/1-beginner/1-Initiation.ipynb', 'repo_name': 'okara83/Becoming-a-Data-Scientist', 'size': '3110'}