Skip to content

Commit 62bd320

Browse files
committed
update: control flow and functions notebooks to remove the errors
1 parent 6b0bfba commit 62bd320

File tree

2 files changed

+45
-161
lines changed

2 files changed

+45
-161
lines changed

control-flow-and-functions-solutions.ipynb

Lines changed: 13 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -107,26 +107,15 @@
107107
},
108108
{
109109
"cell_type": "code",
110-
"execution_count": 2,
110+
"execution_count": null,
111111
"metadata": {
112112
"colab": {
113113
"base_uri": "https://localhost:8080/"
114114
},
115115
"id": "AssoTM92lDzc",
116116
"outputId": "e1535076-609e-47df-fa2e-3b8cae0f8087"
117117
},
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": [],
130119
"source": [
131120
"# Compare numbers\n",
132121
"5 > 2\n",
@@ -705,25 +694,15 @@
705694
},
706695
{
707696
"cell_type": "code",
708-
"execution_count": 5,
697+
"execution_count": null,
709698
"metadata": {
710699
"colab": {
711700
"base_uri": "https://localhost:8080/"
712701
},
713702
"id": "uM0Jzd-8pkIS",
714703
"outputId": "6ecb43f0-e1d0-4c5a-bcec-4f5f354c9302"
715704
},
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": [],
727706
"source": [
728707
"big_cats = [\"ALICE\", \"Bob\", \"CHARLIE\"]\n",
729708
"\n",
@@ -739,33 +718,15 @@
739718
},
740719
{
741720
"cell_type": "code",
742-
"execution_count": 8,
721+
"execution_count": null,
743722
"metadata": {
744723
"colab": {
745724
"base_uri": "https://localhost:8080/"
746725
},
747726
"id": "owyw7y5pqryG",
748727
"outputId": "9a9782ca-8c45-436e-b226-46a4e80b4574"
749728
},
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": [],
769730
"source": [
770731
"# beware of infinite loops!\n",
771732
"i = 0\n",
@@ -855,24 +816,15 @@
855816
},
856817
{
857818
"cell_type": "code",
858-
"execution_count": 13,
819+
"execution_count": null,
859820
"metadata": {
860821
"colab": {
861822
"base_uri": "https://localhost:8080/"
862823
},
863824
"id": "0CRuJdMXyt09",
864825
"outputId": "56fd3e15-c326-4571-ab5e-e224a82f3ac2"
865826
},
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": [],
876828
"source": [
877829
"# We already say lenght and print\n",
878830
"names = [\"Candy\", \"Crystal\", \"Carmen\"]\n",
@@ -884,23 +836,15 @@
884836
},
885837
{
886838
"cell_type": "code",
887-
"execution_count": 15,
839+
"execution_count": null,
888840
"metadata": {
889841
"colab": {
890842
"base_uri": "https://localhost:8080/"
891843
},
892844
"id": "iubWoXLV0Ebg",
893845
"outputId": "37872229-f6f8-4e09-f93b-b2c370284d5b"
894846
},
895-
"outputs": [
896-
{
897-
"name": "stdout",
898-
"output_type": "stream",
899-
"text": [
900-
"150\n"
901-
]
902-
}
903-
],
847+
"outputs": [],
904848
"source": [
905849
"# convert between data types\n",
906850
"num_str = \"100\"\n",
@@ -1213,7 +1157,7 @@
12131157
"id": "yvDkzXUS38I6"
12141158
},
12151159
"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!"
12171161
]
12181162
},
12191163
{
@@ -1237,7 +1181,7 @@
12371181
"id": "5_quY1Py4DXI"
12381182
},
12391183
"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."
12411185
]
12421186
},
12431187
{
@@ -1259,7 +1203,7 @@
12591203
"id": "OQVmfK3U2BoO"
12601204
},
12611205
"source": [
1262-
"**Bonus Try it yourself**:\n",
1206+
"**Try it yourself**:\n",
12631207
"- Create a list of three of your favorite fruits.\n",
12641208
"- Use .append() to add one more fruit.\n",
12651209
"- Use .sort() to arrange them alphabetically.\n",

0 commit comments

Comments
 (0)