{"id":38764,"date":"2016-10-28T23:03:55","date_gmt":"2016-10-29T04:03:55","guid":{"rendered":"http:\/\/101fortec.wordpress.com\/?p=465"},"modified":"2016-10-28T23:03:55","modified_gmt":"2016-10-29T04:03:55","slug":"whats-list","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/whats-list\/","title":{"rendered":"What\u00b4s list?"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/101fortec.wordpress.com\/2016\/10\/29\/whats-list\/\"><a href=\"https:\/\/101fortec.wordpress.com\">101 For Tec<\/a><\/a><\/em><br \/><\/p>\n<p>Today I\u00b4m talking about lists, as I mention in a previous post, a list is a group of items that have a position. The syntax of the lists is like it follows:<\/p>\n<p>name_of_the_list = [elements,elements]<\/p>\n<p>The positions start at 0 and you call them like this<\/p>\n<p>name_of_the_list [0]<\/p>\n<p>Also you can modify them just calling the position and making it equal to the new value<\/p>\n<pre class=\"result notranslate\">list1[0]:  physics<\/pre>\n<p>or delete elements writing del before the position<\/p>\n<pre class=\"prettyprint notranslate tryit prettyprinted\"><span class=\"kwd\">del<\/span><span class=\"pln\"> list1<\/span><span class=\"pun\">[<\/span><span class=\"lit\">2<\/span><span class=\"pun\">];<\/span><\/pre>\n<h2>Also you\u00b4re able to do the basic operations<\/h2>\n<table class=\"table table-bordered\">\n<tbody>\n<tr>\n<th>Python Expression<\/th>\n<th>Results<\/th>\n<th>Description<\/th>\n<\/tr>\n<tr>\n<td>len([1, 2, 3])<\/td>\n<td>3<\/td>\n<td>Length<\/td>\n<\/tr>\n<tr>\n<td>[1, 2, 3] + [4, 5, 6]<\/td>\n<td>[1, 2, 3, 4, 5, 6]<\/td>\n<td>Concatenation<\/td>\n<\/tr>\n<tr>\n<td>[&#8216;Hi!&#8217;] * 4<\/td>\n<td>[&#8216;Hi!&#8217;, &#8216;Hi!&#8217;, &#8216;Hi!&#8217;, &#8216;Hi!&#8217;]<\/td>\n<td>Repetition<\/td>\n<\/tr>\n<tr>\n<td>3 in [1, 2, 3]<\/td>\n<td>True<\/td>\n<td>Membership<\/td>\n<\/tr>\n<tr>\n<td>for x in [1, 2, 3]: print x,<\/td>\n<td>1 2 3<\/td>\n<td>Iteration<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>or for more fun stuff check this:<\/p>\n<p><a href=\"https:\/\/www.tutorialspoint.com\/python\/python_lists.htm\" rel=\"nofollow\">https:\/\/www.tutorialspoint.com\/python\/python_lists.htm<\/a><\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/101fortec.wordpress.com\/465\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/101fortec.wordpress.com\/465\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=101fortec.wordpress.com&#038;blog=115376587&%23038;post=465&%23038;subd=101fortec&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at 101 For Tec Today I\u00b4m talking about lists, as I mention in a previous post, a list is a group of items that have a position. The syntax of the lists is like it follows: name_of_the_list = [elements,elements] The positions start at 0 and you call them like this name_of_the_list [0] Also &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/whats-list\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">What\u00b4s list?<\/span><\/a><\/p>\n","protected":false},"author":31,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[161,209,162,287,102],"class_list":["post-38764","post","type-post","status-publish","format-standard","hentry","category-blogs","category-syndicated","tag-101fortec","tag-abosaurio","tag-fantasmita","tag-fruit-loops","tag-python-101"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38764","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\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=38764"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38764\/revisions"}],"predecessor-version":[{"id":38765,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38764\/revisions\/38765"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=38764"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=38764"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=38764"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}