|
107 | 107 | }, |
108 | 108 | { |
109 | 109 | "cell_type": "code", |
110 | | - "execution_count": 2, |
| 110 | + "execution_count": null, |
111 | 111 | "metadata": { |
112 | 112 | "colab": { |
113 | 113 | "base_uri": "https://localhost:8080/" |
114 | 114 | }, |
115 | 115 | "id": "AssoTM92lDzc", |
116 | 116 | "outputId": "e1535076-609e-47df-fa2e-3b8cae0f8087" |
117 | 117 | }, |
118 | | - "outputs": [ |
119 | | - { |
120 | | - "data": { |
121 | | - "text/plain": [ |
122 | | - "True" |
123 | | - ] |
124 | | - }, |
125 | | - "execution_count": 2, |
126 | | - "metadata": {}, |
127 | | - "output_type": "execute_result" |
128 | | - } |
129 | | - ], |
| 118 | + "outputs": [], |
130 | 119 | "source": [ |
131 | 120 | "# Compare numbers\n", |
132 | 121 | "5 > 2\n", |
|
705 | 694 | }, |
706 | 695 | { |
707 | 696 | "cell_type": "code", |
708 | | - "execution_count": 5, |
| 697 | + "execution_count": null, |
709 | 698 | "metadata": { |
710 | 699 | "colab": { |
711 | 700 | "base_uri": "https://localhost:8080/" |
712 | 701 | }, |
713 | 702 | "id": "uM0Jzd-8pkIS", |
714 | 703 | "outputId": "6ecb43f0-e1d0-4c5a-bcec-4f5f354c9302" |
715 | 704 | }, |
716 | | - "outputs": [ |
717 | | - { |
718 | | - "name": "stdout", |
719 | | - "output_type": "stream", |
720 | | - "text": [ |
721 | | - "ALICE is uppercase\n", |
722 | | - "Bob is not uppercase\n", |
723 | | - "CHARLIE is uppercase\n" |
724 | | - ] |
725 | | - } |
726 | | - ], |
| 705 | + "outputs": [], |
727 | 706 | "source": [ |
728 | 707 | "big_cats = [\"ALICE\", \"Bob\", \"CHARLIE\"]\n", |
729 | 708 | "\n", |
|
739 | 718 | }, |
740 | 719 | { |
741 | 720 | "cell_type": "code", |
742 | | - "execution_count": 8, |
| 721 | + "execution_count": null, |
743 | 722 | "metadata": { |
744 | 723 | "colab": { |
745 | 724 | "base_uri": "https://localhost:8080/" |
746 | 725 | }, |
747 | 726 | "id": "owyw7y5pqryG", |
748 | 727 | "outputId": "9a9782ca-8c45-436e-b226-46a4e80b4574" |
749 | 728 | }, |
750 | | - "outputs": [ |
751 | | - { |
752 | | - "name": "stdout", |
753 | | - "output_type": "stream", |
754 | | - "text": [ |
755 | | - "1\n", |
756 | | - "2\n", |
757 | | - "3\n", |
758 | | - "4\n", |
759 | | - "5\n", |
760 | | - "6\n", |
761 | | - "7\n", |
762 | | - "8\n", |
763 | | - "9\n", |
764 | | - "10\n", |
765 | | - "11\n" |
766 | | - ] |
767 | | - } |
768 | | - ], |
| 729 | + "outputs": [], |
769 | 730 | "source": [ |
770 | 731 | "# beware of infinite loops!\n", |
771 | 732 | "i = 0\n", |
|
855 | 816 | }, |
856 | 817 | { |
857 | 818 | "cell_type": "code", |
858 | | - "execution_count": 13, |
| 819 | + "execution_count": null, |
859 | 820 | "metadata": { |
860 | 821 | "colab": { |
861 | 822 | "base_uri": "https://localhost:8080/" |
862 | 823 | }, |
863 | 824 | "id": "0CRuJdMXyt09", |
864 | 825 | "outputId": "56fd3e15-c326-4571-ab5e-e224a82f3ac2" |
865 | 826 | }, |
866 | | - "outputs": [ |
867 | | - { |
868 | | - "name": "stdout", |
869 | | - "output_type": "stream", |
870 | | - "text": [ |
871 | | - "Second person: Candy\n", |
872 | | - "Number of names 3\n" |
873 | | - ] |
874 | | - } |
875 | | - ], |
| 827 | + "outputs": [], |
876 | 828 | "source": [ |
877 | 829 | "# We already say lenght and print\n", |
878 | 830 | "names = [\"Candy\", \"Crystal\", \"Carmen\"]\n", |
|
884 | 836 | }, |
885 | 837 | { |
886 | 838 | "cell_type": "code", |
887 | | - "execution_count": 15, |
| 839 | + "execution_count": null, |
888 | 840 | "metadata": { |
889 | 841 | "colab": { |
890 | 842 | "base_uri": "https://localhost:8080/" |
891 | 843 | }, |
892 | 844 | "id": "iubWoXLV0Ebg", |
893 | 845 | "outputId": "37872229-f6f8-4e09-f93b-b2c370284d5b" |
894 | 846 | }, |
895 | | - "outputs": [ |
896 | | - { |
897 | | - "name": "stdout", |
898 | | - "output_type": "stream", |
899 | | - "text": [ |
900 | | - "150\n" |
901 | | - ] |
902 | | - } |
903 | | - ], |
| 847 | + "outputs": [], |
904 | 848 | "source": [ |
905 | 849 | "# convert between data types\n", |
906 | 850 | "num_str = \"100\"\n", |
|
1213 | 1157 | "id": "yvDkzXUS38I6" |
1214 | 1158 | }, |
1215 | 1159 | "source": [ |
1216 | | - "**Try it Yourself:** Replace the list item \"orange\" with \"pear.\"" |
| 1160 | + "**Remember:** To replace the list item \"orange\" with \"pear\" we can use indexing!" |
1217 | 1161 | ] |
1218 | 1162 | }, |
1219 | 1163 | { |
|
1237 | 1181 | "id": "5_quY1Py4DXI" |
1238 | 1182 | }, |
1239 | 1183 | "source": [ |
1240 | | - "**Bonus Try it Yourself:** Print the value \"g\" from the list `letter_list`." |
| 1184 | + "**Remember exercise!:** Print the value \"g\" from the list `letter_list`. **Hint:** Indexing can be nested. If you are not sure, check types." |
1241 | 1185 | ] |
1242 | 1186 | }, |
1243 | 1187 | { |
|
1259 | 1203 | "id": "OQVmfK3U2BoO" |
1260 | 1204 | }, |
1261 | 1205 | "source": [ |
1262 | | - "**Bonus Try it yourself**:\n", |
| 1206 | + "**Try it yourself**:\n", |
1263 | 1207 | "- Create a list of three of your favorite fruits.\n", |
1264 | 1208 | "- Use .append() to add one more fruit.\n", |
1265 | 1209 | "- Use .sort() to arrange them alphabetically.\n", |
|
0 commit comments