{"id":38222,"date":"2016-10-24T07:54:35","date_gmt":"2016-10-24T12:54:35","guid":{"rendered":"http:\/\/firstprogrammingsteps.wordpress.com\/?p=278"},"modified":"2016-10-24T07:54:35","modified_gmt":"2016-10-24T12:54:35","slug":"strings-3","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/strings-3\/","title":{"rendered":"Strings"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/firstprogrammingsteps.wordpress.com\/2016\/10\/24\/strings\/\"><a href=\"https:\/\/firstprogrammingsteps.wordpress.com\">Hackerman&amp;#039;s house<\/a><\/a><\/em><br \/><\/p>\n<p><img class=\"alignnone size-full wp-image-70\" src=\"https:\/\/firstprogrammingsteps.files.wordpress.com\/2016\/08\/hackerman.jpg?w=736\" alt=\"hackerman\" srcset=\"https:\/\/firstprogrammingsteps.files.wordpress.com\/2016\/08\/hackerman.jpg?w=736 736w, https:\/\/firstprogrammingsteps.files.wordpress.com\/2016\/08\/hackerman.jpg?w=1472 1472w, https:\/\/firstprogrammingsteps.files.wordpress.com\/2016\/08\/hackerman.jpg?w=150 150w, https:\/\/firstprogrammingsteps.files.wordpress.com\/2016\/08\/hackerman.jpg?w=300 300w, https:\/\/firstprogrammingsteps.files.wordpress.com\/2016\/08\/hackerman.jpg?w=768 768w, https:\/\/firstprogrammingsteps.files.wordpress.com\/2016\/08\/hackerman.jpg?w=1024 1024w\" sizes=\"(max-width: 736px) 100vw, 736px\"   \/><\/p>\n<p>We already have seen that there are a lot of basic types of data in python. In this case we&#8217;ll be using strings. Strings allow us to save a series of letters or numbers, in this case the numbers won&#8217;t be treated like numbers, just as a character, so we won&#8217;t be able to perform mathematical operations with them.<\/p>\n<p>To define a string we have to use quotation &#8220;&#8221; or &#8221;.<\/p>\n<blockquote><p>example = &#8220;Paco&#8221;<\/p>\n<p>example2 = &#8216;Marquez&#8217;<\/p><\/blockquote>\n<p>We can analyze this information using several python functions. To calculate the lenght we do this.<\/p>\n<blockquote><p>print len(example)<\/p><\/blockquote>\n<p>We can also concatenate two strings.<\/p>\n<blockquote><p>Concatenation = example + example2<\/p>\n<p>print(Concatenation)<\/p><\/blockquote>\n<p>This would print PacoMarquez.<\/p>\n<p>We can also repeat a string.<\/p>\n<blockquote><p>Repetition = example * 2<\/p><\/blockquote>\n<p>Also we can obtain a specific character included in the string.<\/p>\n<blockquote><p>nombre = &#8216;Francisco&#8217;<\/p>\n<p>print nombre[0]<\/p><\/blockquote>\n<p>That is the basic information about strings that I will give today, but I have to recognize that there are a lot of things that can be done with this type of data.<\/p>\n<p>Got some nice information here: <a href=\"https:\/\/www.tutorialspoint.com\/python3\/python_strings.htm\" rel=\"nofollow\">https:\/\/www.tutorialspoint.com\/python3\/python_strings.htm<\/a><\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/firstprogrammingsteps.wordpress.com\/278\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/firstprogrammingsteps.wordpress.com\/278\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=firstprogrammingsteps.wordpress.com&#038;blog=115170367&%23038;post=278&%23038;subd=firstprogrammingsteps&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at Hackerman&amp;#039;s house We already have seen that there are a lot of basic types of data in python. In this case we&#8217;ll be using strings. Strings allow us to save a series of letters or numbers, in this case the numbers won&#8217;t be treated like numbers, just as a character, so we &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/strings-3\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Strings<\/span><\/a><\/p>\n","protected":false},"author":59,"featured_media":70,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[24],"class_list":["post-38222","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-python"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38222","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\/59"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=38222"}],"version-history":[{"count":3,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38222\/revisions"}],"predecessor-version":[{"id":38223,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/38222\/revisions\/38223"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=38222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=38222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=38222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}