{"id":38798,"date":"2016-10-28T23:32:39","date_gmt":"2016-10-29T04:32:39","guid":{"rendered":"http:\/\/juanmweb.wordpress.com\/?p=106"},"modified":"2016-10-28T23:32:39","modified_gmt":"2016-10-29T04:32:39","slug":"road-to-masterball-24-or-12","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/road-to-masterball-24-or-12\/","title":{"rendered":"Road to Masterball (2\/4 or 1\/2)!"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/juanmweb.wordpress.com\/2016\/10\/29\/road-to-masterball-24-or-12\/\"><a href=\"https:\/\/juanmweb.wordpress.com\">Programming Blog<\/a><\/a><\/em><br \/><\/p>\n<p>Check the 1st part to know why the name!<\/p>\n<p>3!<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><b>When to use what type of repetition in a program<\/b><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"font-weight:400;\">There\u2019s a trick for what type of repetition you need in a program and it\u2019s the following<\/span><\/p>\n<p><span style=\"font-weight:400;\">For (loop)<\/span><\/p>\n<p><span style=\"font-weight:400;\">You have a small part of your code that you want to repeat \u201cx\u201d number of times.<\/span><\/p>\n<p><span style=\"font-weight:400;\">While (loop)<\/span><\/p>\n<p><span style=\"font-weight:400;\">Keeps running the code until the condition is met, basically it has code and inside a condition.<\/span><\/p>\n<p><span style=\"font-weight:400;\">Nested (loops)<\/span><\/p>\n<p><span style=\"font-weight:400;\">Loop inside a loop<\/span><\/p>\n<p><span style=\"font-weight:400;\">Break (not a loop but a helper)<\/span><\/p>\n<p><span style=\"font-weight:400;\">To be free from a loop, you use the function \u201cBreak\u201d.<\/span><\/p>\n<p><span style=\"font-weight:400;\">Continue (not a loop, but to enter one)<\/span><\/p>\n<p><span style=\"font-weight:400;\">Basically is to skip the rest of the statements in the current loop and to continue to the next part of the code (but can be used to enter another loop if you have a loop inside another loop).<\/span><\/p>\n<p><a href=\"http:\/\/www.pythonforbeginners.com\/loops\/for-while-and-nested-loops-in-python\"><span style=\"font-weight:400;\">http:\/\/www.pythonforbeginners.com\/loops\/for-while-and-nested-loops-in-python<\/span><\/a><\/p>\n<p><img class=\"alignnone size-full wp-image-111\" src=\"https:\/\/juanmweb.files.wordpress.com\/2016\/10\/meme-24.jpg?w=648\" alt=\"meme-24\" srcset=\"https:\/\/juanmweb.files.wordpress.com\/2016\/10\/meme-24.jpg?w=648 648w, https:\/\/juanmweb.files.wordpress.com\/2016\/10\/meme-24.jpg?w=150 150w, https:\/\/juanmweb.files.wordpress.com\/2016\/10\/meme-24.jpg?w=300 300w, https:\/\/juanmweb.files.wordpress.com\/2016\/10\/meme-24.jpg 650w\" sizes=\"(max-width: 648px) 100vw, 648px\"   \/><\/p>\n<p>4!<\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li><b>Creation and use of Lists\/Tuples (Python) or Arrays\/Vectors (C++)<\/b><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><img class=\"alignnone size-full wp-image-88\" src=\"https:\/\/juanmweb.files.wordpress.com\/2016\/10\/tuples.png?w=648\" alt=\"tuples\" srcset=\"https:\/\/juanmweb.files.wordpress.com\/2016\/10\/tuples.png 647w, https:\/\/juanmweb.files.wordpress.com\/2016\/10\/tuples.png?w=150 150w, https:\/\/juanmweb.files.wordpress.com\/2016\/10\/tuples.png?w=300 300w\" sizes=\"(max-width: 648px) 100vw, 648px\"   \/><\/p>\n<p><span style=\"font-weight:400;\">The creation of lists and tuples in python are rather easy and there is just a little difference in how to type it.<\/span><\/p>\n<p><span style=\"font-weight:400;\">A tuple is written with parentheses, but you gotta name the list, and you can\u2019t alter the data inside.<\/span><\/p>\n<p><span style=\"font-weight:400;\">While a list, is written with square brackets and list their elements, and the difference is that you can actually alter the data inside.<\/span><\/p>\n<p><span style=\"font-weight:400;\">if you require more information about this topic you can see a video about both topics.<\/span><\/p>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=RVXIBZvg-W8\"><span style=\"font-weight:400;\">https:\/\/www.youtube.com\/watch?v=RVXIBZvg-W8<\/span><\/a><\/p>\n<p><b>5!<\/b><\/p>\n<p><b>Creation and use of strings<\/b><\/p>\n<p><span style=\"font-weight:400;\">Strings are the most popular types in Python, we can create them simply by enclosing characters in quotes (\u2018\u2019) python treats single quotes the same as double quotes, and the fast way to know what is creating string is coding (LUL)<\/span><img class=\"alignnone size-full wp-image-87\" src=\"https:\/\/juanmweb.files.wordpress.com\/2016\/10\/strings.png?w=648\" alt=\"strings\" srcset=\"https:\/\/juanmweb.files.wordpress.com\/2016\/10\/strings.png 601w, https:\/\/juanmweb.files.wordpress.com\/2016\/10\/strings.png?w=150 150w, https:\/\/juanmweb.files.wordpress.com\/2016\/10\/strings.png?w=300 300w\" sizes=\"(max-width: 601px) 100vw, 601px\"   \/><\/p>\n<p><span style=\"font-weight:400;\">so.. well that\u2019s basically <div class=\"post-limited-image\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/juanmweb.wordpress.com\/106\/\" \/><\/div>\n<div class=\"post-limited-image\"><img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=juanmweb.wordpress.com&#038;blog=115239583&%23038;post=106&%23038;subd=juanmweb&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/><\/div><!--more--> the code line 4 and 5 is to print only a several substring (each letter is a substring)<\/span><\/p>\n<p><span style=\"font-weight:400;\">if you require more information about this there is a good video about strings and more specific points about it <\/span><a href=\"https:\/\/www.youtube.com\/watch?v=v6nD8f-J_XU\"><span style=\"font-weight:400;\">https:\/\/www.youtube.com\/watch?v=v6nD8f-J_XU<\/span><\/a><span style=\"font-weight:400;\"> , \u00a0the coding starts at 1:24<\/span><\/p>\n<p><a href=\"https:\/\/www.tutorialspoint.com\/python\/python_strings.htm\"><span style=\"font-weight:400;\">https:\/\/www.tutorialspoint.com\/python\/python_strings.htm<\/span><\/a><\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/juanmweb.wordpress.com\/106\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/juanmweb.wordpress.com\/106\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=juanmweb.wordpress.com&#038;blog=115239583&%23038;post=106&%23038;subd=juanmweb&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at Programming Blog Check the 1st part to know why the name! 3! &nbsp; When to use what type of repetition in a program &nbsp; There\u2019s a trick for what type of repetition you need in a program and it\u2019s the following For (loop) You have a small part of your code that &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/road-to-masterball-24-or-12\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Road to Masterball (2\/4 or 1\/2)!<\/span><\/a><\/p>\n","protected":false},"author":61,"featured_media":111,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[26],"class_list":["post-38798","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-sin-categoria"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38798","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/users\/61"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=38798"}],"version-history":[{"count":15,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38798\/revisions"}],"predecessor-version":[{"id":42969,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38798\/revisions\/42969"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=38798"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=38798"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=38798"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}