{"id":37036,"date":"2016-08-23T20:26:07","date_gmt":"2016-08-24T01:26:07","guid":{"rendered":"http:\/\/a01228858.wordpress.com\/?p=111"},"modified":"2016-08-23T20:26:07","modified_gmt":"2016-08-24T01:26:07","slug":"pythons-types-of-data","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/pythons-types-of-data\/","title":{"rendered":"Python\u2019s Types of Data"},"content":{"rendered":"<p class=\"syndicated-attribution\"><em> --Originally published at <a href=\"https:\/\/a01228858.wordpress.com\/2016\/08\/24\/pythons-types-of-data\/\"><a href=\"https:\/\/a01228858.wordpress.com\">Py(t)hon<\/a><\/a><\/em><br \/><\/p>\n<p>Python has five standard types of data:<\/p>\n<ul>\n<li>Numbers<\/li>\n<li>Strings<\/li>\n<li>Lists<\/li>\n<li>Tuples<\/li>\n<li>Dictionary<\/li>\n<\/ul>\n<p>The <strong>number<\/strong> type data is used to store numerical values, this are created when you assign a value to the object.<\/p>\n<p>var1 = 5<\/p>\n<p>var2= 15<\/p>\n<p>Pythons support four different numerical types:<\/p>\n<ul>\n<li>int ( signed integers )<\/li>\n<li>long ( long integers, they can also be represented in octal and hexadecimal)<\/li>\n<li>float ( floating point real values)<\/li>\n<li>complex (complex numbers)<\/li>\n<\/ul>\n<p>Some examples, for a clearer view:<\/p>\n<table width=\"521\">\n<tbody>\n<tr>\n<td><strong>int<\/strong><\/td>\n<td><strong>long<\/strong><\/td>\n<td><strong>float<\/strong><\/td>\n<td><strong>complex<\/strong><\/td>\n<\/tr>\n<tr>\n<td>10<\/td>\n<td>51924361L<\/td>\n<td>0.0<\/td>\n<td>3.14j<\/td>\n<\/tr>\n<tr>\n<td>100<\/td>\n<td>-0x19323L<\/td>\n<td>15.20<\/td>\n<td>45.j<\/td>\n<\/tr>\n<tr>\n<td>-786<\/td>\n<td>0122L<\/td>\n<td>-21.9<\/td>\n<td>9.322e-36j<\/td>\n<\/tr>\n<tr>\n<td>080<\/td>\n<td>0xDEFABCECBDAECBFBAEl<\/td>\n<td>32.3+e18<\/td>\n<td>.876j<\/td>\n<\/tr>\n<tr>\n<td>-0490<\/td>\n<td>535633629843L<\/td>\n<td>-90.<\/td>\n<td>-.6545+0J<\/td>\n<\/tr>\n<tr>\n<td>-0x260<\/td>\n<td>-052318172735L<\/td>\n<td>-32.54e100<\/td>\n<td>3e+26J<\/td>\n<\/tr>\n<tr>\n<td>0x69<\/td>\n<td>-4721885298529L<\/td>\n<td>70.2-E12<\/td>\n<td>4.53e-7j<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>In the other hand we have the <strong>String<\/strong> which are a set of values represented inside a quotation mark.\u00a0 Python allows either pairs of single or double. Subsets of the string can be made by a slice operator ([] and [:]). Every set starts at 0 to -1. You can include the sing (+) to add something else and the (*) to repeat that string a number of times. Here is an example for a better understanding:<\/p>\n<p><img class=\"alignnone size-full wp-image-127\" src=\"https:\/\/a01228858.files.wordpress.com\/2016\/08\/string11.png?w=1000\" alt=\"string1\"   \/><\/p>\n<p>The next type is the <strong>list<\/strong>, where you will find items separated by commas and inside brackets, you can access to this list like the string but the difference is that it will appear the complete list of the place you chose, not only a letter or a value; also like the previous you can add something with the (+) and repeat the list with the (*) and example:<\/p>\n<p><img class=\"alignnone size-full wp-image-134\" src=\"https:\/\/a01228858.files.wordpress.com\/2016\/08\/list1.png?w=1000\" alt=\"list1\"   \/><\/p>\n<p>The <strong>tuples <\/strong>are very similar to the lists, but the main difference is that the tuples are enclosed between parenthesis and not brackets as the list, and another main point is that <div class=\"post-limited-image\"><img class=\"alignnone size-full wp-image-138\" src=\"https:\/\/a01228858.files.wordpress.com\/2016\/08\/tuple-1.png?w=1000\" alt=\"tuple 1\"   \/><\/div>\n<div class=\"post-limited-image\"><img class=\"alignnone size-full wp-image-143\" src=\"https:\/\/a01228858.files.wordpress.com\/2016\/08\/dictionarie1.png?w=1000\" alt=\"dictionarie1\"   \/><\/div>\n<div class=\"post-limited-image\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/a01228858.wordpress.com\/111\/\" \/><\/div>\n<div class=\"post-limited-image\"><img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=a01228858.wordpress.com&#038;blog=115152340&%23038;post=111&%23038;subd=a01228858&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/><\/div><!--more--> type cannot be modify\/updated. Here is an example, and at the bottom we see that when I try to modify the tuple it says that tuple doesn\u2019t support that:<\/p>\n<p><img class=\"alignnone size-full wp-image-138\" src=\"https:\/\/a01228858.files.wordpress.com\/2016\/08\/tuple-1.png?w=1000\" alt=\"tuple 1\"   \/><\/p>\n<p>For last we have the <strong>dictionaries<\/strong> that are a relation between a key and a value given to that key, there are enclosed by the braces {}. A key can be almost everything, but are usually numbers or strings, the values can be of any kind. Here is the example:<\/p>\n<p><img class=\"alignnone size-full wp-image-143\" src=\"https:\/\/a01228858.files.wordpress.com\/2016\/08\/dictionarie1.png?w=1000\" alt=\"dictionarie1\"   \/><\/p>\n<p>The page where I found all this information is this one, if you like to check it, or iif you didn&#8217;t understand me :P:<\/p>\n<p><a href=\"http:\/\/www.tutorialspoint.com\/python\/python_variable_types.htm\" rel=\"nofollow\">http:\/\/www.tutorialspoint.com\/python\/python_variable_types.htm<\/a><\/p>\n<p>That will be all #Pug #Types #Basic #Tec #TC101 #Python<\/p>\n<p>&nbsp;<\/p><br \/>  <a rel=\"nofollow\" href=\"http:\/\/feeds.wordpress.com\/1.0\/gocomments\/a01228858.wordpress.com\/111\/\"><img alt=\"\" border=\"0\" src=\"http:\/\/feeds.wordpress.com\/1.0\/comments\/a01228858.wordpress.com\/111\/\" \/><\/a> <img alt=\"\" border=\"0\" src=\"https:\/\/pixel.wp.com\/b.gif?host=a01228858.wordpress.com&#038;blog=115152340&%23038;post=111&%23038;subd=a01228858&%23038;ref=&%23038;feed=1\" width=\"1\" height=\"1\" \/>","protected":false},"excerpt":{"rendered":"<p>&#8211;Originally published at Py(t)hon Python has five standard types of data: Numbers Strings Lists Tuples Dictionary The number type data is used to store numerical values, this are created when you assign a value to the object. var1 = 5 var2= 15 Pythons support four different numerical types: int ( signed integers ) long ( &hellip; <a href=\"https:\/\/kenscourses.com\/tc101fall2016\/syndicated\/pythons-types-of-data\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Python\u2019s Types of Data<\/span><\/a><\/p>\n","protected":false},"author":28,"featured_media":127,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,4],"tags":[78,34,42,24,33,36,114],"class_list":["post-37036","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-syndicated","tag-basic","tag-isc","tag-pug","tag-python","tag-tc101","tag-tec","tag-types"],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/37036","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\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/comments?post=37036"}],"version-history":[{"count":2,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/37036\/revisions"}],"predecessor-version":[{"id":38097,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/posts\/37036\/revisions\/38097"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/media?parent=37036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/categories?post=37036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2016\/wp-json\/wp\/v2\/tags?post=37036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}