<jupyter_start><jupyter_text>EPA-1316 Introduction to *Urban* Data Science  Homework 1: Introduction to Python and its Numerical Stack**TU Delft****Q1 2020****Instructor:** <NAME> **TAs:** <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME> **[Computational Urban Science & Policy Lab](https://research.trivikverma.com/)** ---  Homework exercises to work on your own  Exercise 1: Try to reproduce, using markdown and the different tools the notebook affords you, the following WikiPedia entry:> https://en.wikipedia.org/wiki/Chocolate_chip_cookie_dough_ice_cream<jupyter_code>from IPython.display import IFrame
IFrame('https://en.wikipedia.org/wiki/Chocolate_chip_cookie_dough_ice_cream', 
              700, 500)<jupyter_output><empty_output><jupyter_text>Do not over think it. Focuse and pay special attention to getting the bold, italics, links, headlines and lists correctly formated, but don't worry too much about the overall layout. Bonus if you manage to insert the image as well (it does not need to be properly placed as in the original page)!<jupyter_code># your code here<jupyter_output><empty_output><jupyter_text>Exercise 2: Write a properly documented function with the following behaviour:- It has a meaningful name (i.e. it is related to its behaviour).- It takes an integer that represents the length of a sequence that will be created.- It creates a dictionary that is empty.- It loops over the sequence and stores each number as the key of an entry in the dictionary, assigning either "odd" or "even" to the value, depending on the type of number.- Returns the dictionary.<jupyter_code># your code here<jupyter_output><empty_output><jupyter_text>Exercise 3:  Create a tuple called `tup` with the following seven objects: - The first element is an integer of your choice- The second element is a float of your choice  - The third element is the sum of the first two elements- The fourth element is the difference of the first two elements- The fifth element is the first element divided by the second element- Display the output of `tup`.  What is the type of the variable `tup`? What happens if you try and chage an item in the tuple?<jupyter_code># your code here<jupyter_output><empty_output><jupyter_text>Exercise 4: Build a list that contains every prime number between 1 and 100, in two different ways:     - 2.1 Using for loops and conditional if statements.- 2.2 **(Stretch Goal)** Using a list comprehension.  You should be able to do this in one line of code. **Hint:** it might help to look up the function `all()` in the documentation.<jupyter_code># your code here<jupyter_output><empty_output><jupyter_text>Exercise 5: Write a function to test the "prime-ness" of a number.    In Exercise 4, above, you wrote code that generated a list of the prime numbers between 1 and 100. Now, write a function called `isprime()` that takes in a positive integer $N$, and determines whether or not it is prime.  Return `True` if it's prime and return `False` if it isn't. Then, using a list comprehension and `isprime()`, create a list `myprimes` that contains all the prime numbers less than 100.<jupyter_code># your code here<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.07893081761006289, 'fraction_numerical': 0.011635220125786163, 'mean_word_length': 5.013232514177694, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 34, 'https://': 3, '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': '6', 'dir': 'jupyter-structured-clean-dedup', 'id': '567097', 'license': 'MIT', 'n_tokens_mistral': 915, 'n_tokens_neox': 861, 'n_words': 437, 'path': 'static/epa1316-2020/labs/lab-01/hw-01.ipynb', 'repo_name': 'trivikverma/researchgroup', 'size': '3248'}