{"id":203,"date":"2020-11-10T09:13:24","date_gmt":"2020-11-10T09:13:24","guid":{"rendered":"http:\/\/lamiaiftekhar.com\/?page_id=203"},"modified":"2020-11-10T09:13:24","modified_gmt":"2020-11-10T09:13:24","slug":"20-minutes-python-day-4","status":"publish","type":"page","link":"https:\/\/lamiaiftekhar.com\/index.php\/20-minutes-python-day-4\/","title":{"rendered":"20-Minutes Python: Day 4"},"content":{"rendered":"<body>\n<p>Today we continue exploring the capabilities of Markdown mode.\u00a0 Utilizing Markdown well can really help you document your studies\/ code better.<\/p>\n\n\n\n<ol class=\"wp-block-list\" type=\"1\"><li>In MS Word, you could insert an image, right?\u00a0 We must be able to do something similar in Markdown otherwise it will fall behind the competition!<\/li><\/ol>\n\n\n\n<p>Image insertion is easy if is it uploaded online.\u00a0\u00a0 Just write \u2018!\u2019 followed by a \u2018[]\u2019 , then the image link ( from where it is uploaded).\u00a0\u00a0<\/p>\n\n\n\n<p>Type and run ( you can copy the link actually \u2013 no need to type)<\/p>\n\n\n\n<p>![](<a href=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/e\/ea\/Dhaka_21st_March_%2825870222381%29.jpg\">https:\/\/upload.wikimedia.org\/wikipedia\/commons\/e\/ea\/Dhaka_21st_March_%2825870222381%29.jpg<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>2. If you want a image caption to appear when you hover your mouse above the image, you can put that caption in quotation before closing the parenthesis.<\/p>\n\n\n\n<p>Type and run:<\/p>\n\n\n\n<p>![](<a href=\"https:\/\/upload.wikimedia.org\/wikipedia\/commons\/e\/ea\/Dhaka_21st_March_%2825870222381%29.jpg\">https:\/\/upload.wikimedia.org\/wikipedia\/commons\/e\/ea\/Dhaka_21st_March_%2825870222381%29.jpg<\/a> \u201cDhaka is pretty!\u201d)<\/p>\n\n\n\n<p>3. Ok now we will learn something that may actually help us annotate our study note better.\u00a0 How about you want to explain or discuss some piece of code for yourself or others but you do not want to execute the code.\u00a0 Sure you can take a screenshot of that code and insert it as an image like above. But there is a better way.<\/p>\n\n\n\n<p>Type and run:<\/p>\n\n\n\n<p><strong>\u201c`python<\/strong><\/p>\n\n\n\n<p><strong>#Let\u2019s print something<\/strong><\/p>\n\n\n\n<p><strong>\u00a0 print(\u201cHi, I\u2019m a little bit of Python code!\u201d)<\/strong><\/p>\n\n\n\n<p><strong>\u201c`<\/strong><\/p>\n\n\n\n<p>4. What did you see above?\u00a0 All the formatting came in the output exactly like a real python code ( the colors and italics and all).\u00a0\u00a0 You can even insert piece of codes from C++, Java, MATLAB etc.\u00a0 You just have to replace\u00a0 the language name above.<\/p>\n\n\n\n<p>Type and run:<\/p>\n\n\n\n<p><strong>\u201c`c++<\/strong><\/p>\n\n\n\n<p><strong>#include &lt;iostream&gt;<\/strong><\/p>\n\n\n\n<p><strong>using namespace std;<\/strong><\/p>\n\n\n\n<p><strong>\/\/ Let\u2019s print something!<\/strong><\/p>\n\n\n\n<p><strong>int main() {<\/strong><\/p>\n\n\n\n<p><strong>\u00a0\u00a0 cout &lt;&lt; \u201cHello, I am a tiny C++ code\u201d;<\/strong><\/p>\n\n\n\n<p><strong>\u00a0\u00a0 return 0;<\/strong><\/p>\n\n\n\n<p><strong>}<\/strong><\/p>\n\n\n\n<p><strong>\u201c`<\/strong><\/p>\n\n\n\n<p>4. Type and run:<\/p>\n\n\n\n<p>\u201c`OCTAVE<\/p>\n\n\n\n<p>%% This is a matrix full of zeros<\/p>\n\n\n\n<p>M = zeros(2,2)<\/p>\n\n\n\n<p>M = M+4\u00a0 % Now this is matrix full of 4<\/p>\n\n\n\n<p>disp(\u201cMatlab is not recognized as a parameter\u00a0 here, that\u2019s why we are choosing the open source alternative OCTAVE\u201d)<\/p>\n\n\n\n<p>\u201c`<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>5. And finally we could insert beautiful equations in the Markdown by using \u2018$\u2019 signs in the front and back .<\/p>\n\n\n\n<p>Type and run:<\/p>\n\n\n\n<p><strong>This was a life-saver back at school!<\/strong><\/p>\n\n\n\n<p><strong>$a^2-b^2=(a+b)(a-b)$<\/strong><\/p>\n<\/body>","protected":false},"excerpt":{"rendered":"<p>Today we continue exploring the capabilities of Markdown mode.\u00a0 Utilizing Markdown well can really help you document your studies\/ code better. In MS Word, you could insert an image, right?\u00a0 We must be able to do something similar in Markdown otherwise it will fall behind the competition! Image insertion is easy if is it uploaded [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-203","page","type-page","status-publish","hentry","entry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/lamiaiftekhar.com\/index.php\/wp-json\/wp\/v2\/pages\/203","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lamiaiftekhar.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/lamiaiftekhar.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/lamiaiftekhar.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lamiaiftekhar.com\/index.php\/wp-json\/wp\/v2\/comments?post=203"}],"version-history":[{"count":1,"href":"https:\/\/lamiaiftekhar.com\/index.php\/wp-json\/wp\/v2\/pages\/203\/revisions"}],"predecessor-version":[{"id":204,"href":"https:\/\/lamiaiftekhar.com\/index.php\/wp-json\/wp\/v2\/pages\/203\/revisions\/204"}],"wp:attachment":[{"href":"https:\/\/lamiaiftekhar.com\/index.php\/wp-json\/wp\/v2\/media?parent=203"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}