|
26 | 26 | " - [The `enumerate` built-in](#The-enumerate-built-in)\n", |
27 | 27 | " - [The `range` built-in](#The-range-built-in)\n", |
28 | 28 | "- [Warm-up Exercises](#Warm-up-Exercises)\n", |
29 | | - " 1. [Write a Python program that returns the characters in a string and their indexes](#1.-Write-a-Python-program-that-returns-the-characters-in-a-string-and-their-indexes)\n", |
30 | | - " 2. [Write a Python program that returns all the numbers in a given range, __including__ the first and the last elements](#2.-Write-a-Python-program-that-returns-all-the-numbers-in-a-given-range,-including-the-first-and-the-last-elements)\n", |
31 | | - " 3. [Write a Python program that takes a list of integers and returns the square root of each of them](#3.-Write-a-Python-program-that-takes-a-list-of-integers-and-returns-the-square-root-of-each-of-them)\n", |
32 | | - " 4. [Write a Python program that takes an integer and divides it by 2 until the result is no longer an even number](#4.-Write-a-Python-program-that-takes-an-integer-and-divides-it-by-2-until-the-result-is-no-longer-an-even-number)\n", |
| 29 | + " 1. [Characters in a string](#Characters-in-a-string)\n", |
| 30 | + " 2. [Range of integers](#Range-of-integers)\n", |
| 31 | + " 3. [List of squares](#List-of-squares)\n", |
| 32 | + " 4. [Divide by two](#Divide-by-two)\n", |
33 | 33 | "- [Altering loops](#Altering-loops)\n", |
34 | 34 | " - [`if` statement inside `for`/`while`](#if-statement-inside-for/while)\n", |
35 | 35 | " - [Exercise: conditionals inside loops](#Exercise:-conditionals-inside-loops)\n", |
|
91 | 91 | "id": "5", |
92 | 92 | "metadata": {}, |
93 | 93 | "source": [ |
94 | | - "Python [supports](./01_basic_datatypes.ipynb#Comparison-operators) different comparison expressions.\n", |
| 94 | + "Python supports different [comparison expressions](./01_basic_datatypes.ipynb#Comparison-operators).\n", |
95 | 95 | "They are called **logical expressions** as they evaluate to either `True` or `False`.\n", |
96 | 96 | "\n", |
97 | 97 | "We can use these results in **conditional statements**, and have our program behave differently based on the result." |
|
586 | 586 | "id": "31", |
587 | 587 | "metadata": {}, |
588 | 588 | "source": [ |
589 | | - "#### 1. Write a Python program that returns the characters in a string and their indexes\n", |
| 589 | + "### Characters in a string\n", |
| 590 | + "Write a Python program that returns the characters in a string and their indexes.\n", |
590 | 591 | "\n", |
591 | 592 | "\n", |
592 | 593 | "<div class=\"alert alert-block alert-warning\">\n", |
|
616 | 617 | "\n", |
617 | 618 | " Returns:\n", |
618 | 619 | " - A list of tuples where each tuple contains:\n", |
619 | | - " - index (int): The position of the character in the string\n", |
620 | | - " - char (str): The character at that position\n", |
| 620 | + " - char (str): A string's character\n", |
| 621 | + " - index (int): The position of that character in the string\n", |
621 | 622 | " \"\"\"\n", |
622 | 623 | " return" |
623 | 624 | ] |
|
629 | 630 | "tags": [] |
630 | 631 | }, |
631 | 632 | "source": [ |
632 | | - "#### 2. Write a Python program that returns all the numbers in a given range, including the first and the last elements\n", |
| 633 | + "### Range of integers\n", |
| 634 | + "Write a Python program that returns all the numbers in a given range, including the first and the last elements.\n", |
| 635 | + "When we say *increasing* or *decreasing*, we mean the **canonical** (or natural) ordering of integers.\n", |
633 | 636 | "\n", |
634 | 637 | "<div class=\"alert alert-block alert-warning\">\n", |
635 | 638 | " <h4><b>Note</b></h4>\n", |
|
670 | 673 | "tags": [] |
671 | 674 | }, |
672 | 675 | "source": [ |
673 | | - "#### 3. Write a Python program that takes a list of integers and returns the square root of each of them\n", |
| 676 | + "### List of squares\n", |
| 677 | + "\n", |
| 678 | + "Write a Python program that takes a list of integers and returns the square root of each of them.\n", |
674 | 679 | "\n", |
675 | 680 | "<div class=\"alert alert-block alert-info\">\n", |
676 | 681 | " <h4><b>Hints</b></h4>\n", |
677 | 682 | " <ul>\n", |
678 | 683 | " <li>You can use the <code>math.sqrt</code> function to compute the square root of a number</li>\n", |
679 | 684 | " <li>If a number does not have a square root in the real domain, you should skip it</li>\n", |
680 | 685 | " </ul>\n", |
681 | | - "</div>" |
| 686 | + "</div>\n" |
682 | 687 | ] |
683 | 688 | }, |
684 | 689 | { |
|
714 | 719 | "id": "37", |
715 | 720 | "metadata": {}, |
716 | 721 | "source": [ |
717 | | - "#### 4. Write a Python program that takes an integer and divides it by 2 until the result is no longer an even number" |
| 722 | + "### Divide by two\n", |
| 723 | + "\n", |
| 724 | + "Write a Python program that takes an integer and divides it by 2 until the result is no longer an even number" |
718 | 725 | ] |
719 | 726 | }, |
720 | 727 | { |
|
1933 | 1940 | "name": "python", |
1934 | 1941 | "nbconvert_exporter": "python", |
1935 | 1942 | "pygments_lexer": "ipython3", |
1936 | | - "version": "3.10.15" |
| 1943 | + "version": "3.12.12" |
1937 | 1944 | }, |
1938 | 1945 | "toc-autonumbering": false, |
1939 | 1946 | "toc-showmarkdowntxt": false, |
|
0 commit comments