|
52 | 52 | "source": [ |
53 | 53 | "## Q 2\n", |
54 | 54 | "\n", |
55 | | - "To iterate over the tuples, where the _i_-th tuple contains _i_-th elements of certain sequences, we can use `zip(*sequences)` function.\n", |
| 55 | + "To iterate over the tuples, where the _i_-th tuple contains the _i_-th elements of certain sequences, we can use `zip(*sequences)` function.\n", |
56 | 56 | "\n", |
57 | 57 | "We will iterate over two lists, `names` and `age`, and print out the resulting tuples.\n", |
58 | 58 | "\n", |
|
78 | 78 | "source": [ |
79 | 79 | "## Q 3\n", |
80 | 80 | "\n", |
81 | | - "The function `enumerate(sequence)` returns tuples containing indecies of objects in the sequence, and the objects. \n", |
| 81 | + "The function `enumerate(sequence)` returns tuples containing indicies of objects in the sequence, and the objects. \n", |
82 | 82 | "\n", |
83 | | - "The `random` module provides tools for working with the random objects. In particular, `random.randint(start, end)` generates a random number not smaller than `start`, and not bigger than `end`.\n", |
| 83 | + "The `random` module provides tools for working with the random numbers. In particular, `random.randint(start, end)` generates a random number not smaller than `start`, and not bigger than `end`.\n", |
84 | 84 | "\n", |
85 | 85 | " * Generate a list of 10 random numbers from 0 to 9.\n", |
86 | 86 | " \n", |
87 | | - " * Using the `enumerate(random_list)` function, iterate over the tuples of random numbers and their indecies, and print out *\"Match: NUMBER and INDEX\"* if the random number and its index in the list match." |
| 87 | + " * Using the `enumerate(random_list)` function, iterate over the tuples of random numbers and their indicies, and print out *\"Match: NUMBER and INDEX\"* if the random number and its index in the list match." |
88 | 88 | ] |
89 | 89 | }, |
90 | 90 | { |
|
449 | 449 | "name": "python", |
450 | 450 | "nbconvert_exporter": "python", |
451 | 451 | "pygments_lexer": "ipython3", |
452 | | - "version": "3.6.3" |
| 452 | + "version": "3.6.4" |
453 | 453 | } |
454 | 454 | }, |
455 | 455 | "nbformat": 4, |
|
0 commit comments