Appendix

About

This section is included to assist the students to perform the activities in the book. It includes detailed steps that are to be performed by the students to achieve the objectives of the activities.

Solution of Activity 1: Handling Lists

These are the steps to complete this activity:

  1. Import the random library:

    import random

  2. Set the maximum number of random numbers:

    LIMIT = 100

  3. Use the randint function from the random library to create 100 random numbers. Tip: try getting a list with the least number of duplicates:

    random_number_list = [random.randint(0, LIMIT) for x in range(0, LIMIT)]

  4. Print random_number_list:

    random_number_list

    The sample output is as follows:

    Figure 1.16: Section of output for random_number_list
  5. Create ...

Get Data Wrangling with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.