-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUsing_markdowns.ipynb.txt
295 lines (295 loc) · 18.3 KB
/
Using_markdowns.ipynb.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
{
"metadata": {
"kernelspec": {
"name": "python",
"display_name": "Python (Pyodide)",
"language": "python"
},
"language_info": {
"codemirror_mode": {
"name": "python",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8"
}
},
"nbformat_minor": 4,
"nbformat": 4,
"cells": [
{
"cell_type": "markdown",
"source": "<p style=\"text-align:center\">\n <a href=\"https://skills.network/?utm_medium=Exinfluencer&utm_source=Exinfluencer&utm_content=000026UJ&utm_term=10006555&utm_id=NA-SkillsNetwork-Channel-SkillsNetworkCoursesIBMDeveloperSkillsNetworkPY0101ENSkillsNetwork19487395-2022-01-01\" target=\"_blank\">\n <img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/assets/logos/SN_web_lightmode.png\" width=\"200\" alt=\"Skills Network Logo\" />\n </a>\n</p>\n\n# Lab: Using Markdowns in Jupyter Notebooks\n\nEstimated time needed: **15** minutes\n\nJupyter Notebooks are composed of code and markdown cells. Markdown cells are used to present text, images, etc. and are useful to document and explain the contents of your notebook. In this lab you will become familiar with writing markdown.\n\n## Objectives\n\nAfter completing this lab, you will be able to:\n*\tIdentify which Kernel your Jupyter notebook is running\n*\tCreate headings, and add text in bold and italics in Markdown\n*\tInsert links and images using Markdown\n*\tCreate Tables in Markdown\n*\tCreate ordered and unordered lists in Markdown\n*\tDemonstrate your proficiency in using Markdown in Jupyter notebooks\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "# Exercise 1 \n\n### Kernels in Jupyter notebook\n\n* A notebook kernel is a computational engine that executes the code in a Notebook file. \n \n* When the notebook is executed, the kernel performs the computation and produces the results. \n\n* The top right corner tells you what kind of kernel it is. For instance, in JupyterLite, the default kernel is **Pyolite**. Similarly, if you are working on JupyterLab, the kernel will be **Python 3** or **Python 2**, depending on the version.\n\n<img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/kernelforjupyterlite.jpg\">\n\n\n* You can also run other kernels by choosing the preferred kernel on the **launch page** or by clicking the top right to switch the kernel to the preferred kernel and picking the kernel from the drop-down menu. \n\n* When the kernel is in execution, the state of the kernel is changed from **Idle** to **Running** state.\n\n#### Try yourself:\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "* Click the running Kernel, For Example, **Pyolite**, to see which other kernels are available.<br/>\n\n > _Please don't switch the existing kernel._\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "<details><summary>Click here for the solution</summary>\n\nThe output looks as:\n\n<img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/kernel2.png\">\n\n</details>\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "* Check the state of the kernel by clicking on the circle next to it.\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "<details><summary>Click here for the solution</summary>\n\nThe output looks as:\n\n<img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/kernel3.png\">\n\n</details>\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "# Exercise 2\n### Create headings, and add text in bold and italics in Markdown\n\nLet us explore basic markdown elements such as: \n* Headings\n* Bold Text\n* ItalicText\n\n\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "### Headings:\n\n* You can create headings by adding a <code>#</code> sign before a **word** or a **phrase**.\n\n * There are six levels of headings.\n * The number sign <code>#</code> indicate the level of heading for example **# Hello** corresponds to **level 1**,the highest level heading.\n * Display the following text using six different heading levels.\n * H1: This is a level 1 Heading\n * H2: This is a level 2 Heading\n * H3: This is a level 3 Heading\n * H4: This is a level 4 Heading\n * H5: This is a level 5 Heading\n * H6: This is a level 6 Heading\n > Recall: to convert a code cell to markdown, first click inside the cell, then on the dropdown labelled **\"Code\"** in the toolbar bar and select **\"Markdown\"**. To run a cell, click inside the cell then press <kbd>Shift+Enter keys</kbd> together. \n <img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/markdown1.png\">\n \n * Convert the cell below to markdown cell and execute it.\n * To see or edit the contents of a rendered Markdown cell after running it double-click on the cell. \n",
"metadata": {}
},
{
"cell_type": "code",
"source": "# Execute it as a markdown cell\n# H1: This is a level 1 Heading\n## H2: This is a level 2 Heading\n### H3: This is a level 3 Heading\n#### H4: This is a level 4 Heading\n##### H5: This is a level 5 Heading\n###### H6: This is a level 6 Heading",
"metadata": {
"trusted": true
},
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": "<details><summary>Click here for the solution</summary>\n\nThe output looks as:\n\n<img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/markdown3.png\">\n\n<img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/markdown2.png\">\n\n</details>\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "### Bold Text\n\n* You can create bold text by adding two asterisks or underscores before and after a word,phrase or a sentence.\n\n* Convert the cell below to markdown cell and execute it.\n",
"metadata": {}
},
{
"cell_type": "code",
"source": "# Execute it as a markdown cell\n**Bold Text using asterisks.** \n__Bold Text using underscores.__",
"metadata": {},
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": "### Italic Text\n\n* You can display text in italics by adding a single asterisk or underscore before and after a word,phrase or a sentence.\n\n* Convert the cell below to markdown cell and execute it.\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "# Execute it as a markdown cell\n*Text in italics using asterisk.* \n_Text in italics using underscore._\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "### Bold and Italic text\n* You can display text in both bold and italic style at the same time by adding a three asterisks or underscores before and after a word,phrase or a sentence.\n\n* Convert the cell below to markdown cell and execute it.\n",
"metadata": {}
},
{
"cell_type": "code",
"source": "# Execute it as a markdown cell\n***Bold and Italic text using asterisks.*** \n___Bold and Italic text using underscores.___",
"metadata": {},
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": "# Exercise 3\n### Insert links and images using Markdown\n\n* Hyperlinks\n* Images\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "### Hyperlinks\nYou can create a **hyperlink** in the following format.\n\n<img src=\"https://raw.githubusercontent.com/Lakshmiholla-2808/first/main/hyper1.png\">\n\n* **Name of the link** is the clickable link text\n* **Link url** is the web address of the url which will be directed on clicking the link.\n* To display a clickable link without a name enclose the link in angle brackets.\n<https://skills.network/ >\n\n_Convert the code cell below to a markdown cell. Then create a hyperlink to the webpage **https://skills.network** with the **Name of the Link** as \"Skills Network\". Then execute the code._\n",
"metadata": {}
},
{
"cell_type": "code",
"source": "# Execute it as a markdown cell\n[Skills Network](https://skills.network/) ",
"metadata": {
"trusted": true
},
"outputs": [
{
"ename": "<class 'SyntaxError'>",
"evalue": "invalid syntax. Perhaps you forgot a comma? (<ipython-input-3-1ec62516b954>, line 2)",
"output_type": "error",
"traceback": [
"\u001b[0;36m Cell \u001b[0;32mIn [3], line 2\u001b[0;36m\u001b[0m\n\u001b[0;31m [Skills Network](https://skills.network/)\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax. Perhaps you forgot a comma?\n"
]
}
],
"execution_count": 3
},
{
"cell_type": "markdown",
"source": "### Images\n\nImages can be rendered in the following format.\n \n<img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/image.png\">\n\nConvert the cell below to markdown cell and execute it.\n",
"metadata": {}
},
{
"cell_type": "code",
"source": "# Execute it as a markdown cell\nLOGO: ![This is the skills network logo](https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/assets/logos/SN_web_lightmode.png)",
"metadata": {},
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": "# Exercise 4 \n\n### Create Tables in Markdown\n\nTo create tables, use: \n* **hyphens** <code>(----)</code> for column headers \n* **pipes** <code>|</code> to separate each column\n* **Text on a new line** to separate each row\n\n<img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/tabledisp.png\">\n\n_Convert the code cell below to a markdown cell. Then recreate the example table above and execute the code._\n",
"metadata": {}
},
{
"cell_type": "code",
"source": "## Execute as a markdown cell\n\n| Country Name | Capital |\n| -------------| ------ |\n| United States | Washington DC |\n| Australia | Canberra |\n| India | New Delhi |",
"metadata": {},
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": "A table is created with <code>1</code> heading row, <code>3</code> body rows, and <code>2</code> columns.\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "# Exercise 4 \n\n### Create ordered and unordered lists in Markdown\n\n#### Unordered List\n\nAn unordered list is also referred to as a **bulleted list**.\n\nYou can create an unordered list by add **dashes (-), asterisks (*), or plus signs (+)** in front of line items.\n\n<img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/unordered.png\">\n\n_Convert the code cell below to a markdown cell. Then recreate the unordered list displayed above using **dashes (-), asterisks (*),** and **plus signs (+).** Then execute the code._\n",
"metadata": {}
},
{
"cell_type": "code",
"source": "# Execute as a markdown cell\n- First item using dashes\n- Second item using dashes\n- Third item using dashes\n- Fourth item using dashes\n\n* First item using asterisks\n* Second item using asterisks\n* Third item using asterisks\n* Fourth item using asterisks\n\n+ First item using plus\n+ Second item using plus\n+ Third item using plus\n+ Fourth item using plus",
"metadata": {
"trusted": true
},
"outputs": [
{
"ename": "<class 'SyntaxError'>",
"evalue": "invalid syntax (<ipython-input-4-bdc94563f547>, line 2)",
"output_type": "error",
"traceback": [
"\u001b[0;36m Cell \u001b[0;32mIn [4], line 2\u001b[0;36m\u001b[0m\n\u001b[0;31m - First item using dashes\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
]
}
],
"execution_count": 4
},
{
"cell_type": "markdown",
"source": "\n#### Ordered List\n\nWe can create an ordered list by adding line items with **numbers** followed by **periods**.\n\n <img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/list.png\">\n\n_Convert the code cell below to a markdown cell. Then recreate the ordered list displayed above and execute the code._\n",
"metadata": {}
},
{
"cell_type": "code",
"source": "# Execute as a markdown cell\n1. First item\n2. Second item\n3. Third item\n4. Fourth item\n",
"metadata": {},
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": "# Practice Exercises\n\n### Demonstrate your proficiency in using Markdown in Jupyter notebooks\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "#### Task 1: Create **H2 level heading** as **Welcome to Python programming** and add the image from the following **url** with alt text as **This is SN labs New Launcher**\n\n_https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/Launcher.png_\n",
"metadata": {}
},
{
"cell_type": "code",
"source": "## Write your markdown here",
"metadata": {
"trusted": true
},
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": "<details><summary>Click here for the solution</summary>\n\n```python\n## Welcome to Python programming\nLauncher:![This is SN labs New Launcher](https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/Launcher.png)\n\n```\nOutput look as:\n\n<img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/Launcheroutput.png\">\n\n</details>\n\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "#### Task 2: Create a hyperlink to <code>https://www.coursera.org/learn/open-source-tools-for-data-science/home</code> with the **Name of the link** as \"Tools For Data Science\".\n",
"metadata": {}
},
{
"cell_type": "code",
"source": "# Write your markdown here",
"metadata": {},
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": "<details><summary>Click here for the solution</summary>\n\n```\n<a href =\"https://www.coursera.org/learn/open-source-tools-for-data-science/home/\">Tools For Data Science</a> \n \n```\n\n</details>\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "#### Task 3: Create the following table:\n\n <img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/table.png\">\n",
"metadata": {}
},
{
"cell_type": "code",
"source": "# Write your markdown here",
"metadata": {},
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": "<details><summary>Click here for the solution</summary>\n\n```\n|Fruits | Quantity(Kg) | Price(In Rupee) | \n| ------ | ------ | ------ | \n| Apple | 2 |500|\n|Orange | 1 |200|\n| Mango | 3 |1000|\n| Grapes | 2 |400|\n\n \n```\n\n</details>\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "#### Task 4: Create the following ordered list:\n\n<img src=\"https://cf-courses-data.s3.us.cloud-object-storage.appdomain.cloud/IBMDeveloperSkillsNetwork-DS0105EN-SkillsNetwork/labs/Labs_V4/images/order1.png\">\n",
"metadata": {}
},
{
"cell_type": "code",
"source": "# Write your markdown here",
"metadata": {},
"outputs": [],
"execution_count": null
},
{
"cell_type": "markdown",
"source": "<details><summary>Click here for the solution</summary>\n\n```\n1. Python\n2. Java\n3. C++\n4. C \n```\n\n</details>\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "_You can find more rules for Markdown formatting in this Markdown Cheatsheet: https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet_\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "### Thank you for completing this lab!\n\n",
"metadata": {}
},
{
"cell_type": "markdown",
"source": "## Author\n\n[Lakshmi Holla](https://www.linkedin.com/in/lakshmi-holla-b39062149/?utm_medium=Exinfluencer&utm_source=Exinfluencer&utm_content=000026UJ&utm_term=10006555&utm_id=NA-SkillsNetwork-Channel-SkillsNetworkCoursesIBMDeveloperSkillsNetworkDS0105ENSkillsNetwork984-2022-01-01) \n\n[Malika Singla](https://www.linkedin.com/in/malika-goyal-04798622/?utm_medium=Exinfluencer&utm_source=Exinfluencer&utm_content=000026UJ&utm_term=10006555&utm_id=NA-SkillsNetwork-Channel-SkillsNetworkCoursesIBMDeveloperSkillsNetworkDS0105ENSkillsNetwork984-2022-01-01)\n\n\n## Change Log\n\n| Date (YYYY-MM-DD) | Version | Changed By | Change Description |\n| ----------------- | ------- | ---------- | ---------------------------------- |\n| 2022-09-30 | 0.1 | Lakshmi Holla | Created Initial version |\n\n\n## <h3 align=\"center\"> © IBM Corporation 2022. All rights reserved. <h3/>\n",
"metadata": {}
}
]
}