Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php on line 152

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831

Warning: Cannot modify header information - headers already sent by (output started at /home/kenbauer/public_kenscourses/tc101fall2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101fall2015/wp-includes/rest-api/class-wp-rest-server.php on line 1831
{"id":26987,"date":"2015-11-23T11:38:42","date_gmt":"2015-11-23T17:38:42","guid":{"rendered":"http:\/\/asimplemaniseepythonipresslike.wordpress.com\/?p=149"},"modified":"2015-11-23T11:38:42","modified_gmt":"2015-11-23T17:38:42","slug":"basic-types-and-their-use-in-python3","status":"publish","type":"post","link":"https:\/\/kenscourses.com\/tc101fall2015\/2015\/basic-types-and-their-use-in-python3\/","title":{"rendered":"Basic Types and their use in Python3"},"content":{"rendered":"

Hi in Python 3 we have 6 Basic Types for categorize things, let me show you:<\/span><\/p>\n

In Python 3 we have:<\/span><\/p>\n

INTEGERS
\n<\/strong>We can say an ‘integer’ is an integer, some examples of this could be:
\n1, 23, 3909, -23, 4, -189
\n<\/span><\/p>\n

\"explodingnumbers_mainpic\"<\/p>\n

Unlike other programming languages python use Integers not matter how high or small it is as long as it is integer the type of the number will be INTEGER
\n<\/span><\/p>\n

With INTEGERS we can do many things, the basic could be math like:<\/span><\/p>\n

\n

>>>3+9
\n12<\/span><\/p>\n<\/blockquote>\n

\n

>>> 5-6
\n-1<\/span><\/p>\n<\/blockquote>\n

But also INTEGERS can be used in the rest of the program, they are a essential part of Python, you\u00a0 have to be very attentive in do not confuse with string because 43 != ’43’.<\/span><\/p>\n

Example of assign a INTEGER to a variable and assign a INTEGER of an input.<\/span><\/p>\n

\n

>>>num_Int = 3<\/span><\/p>\n

#The first number is a variable that has the value of 3<\/span><\/p>\n

>>>input_Int= int(input(‘Give me a number’))<\/span><\/p>\n

#The second ask for the user to put a number and covert it to INTEGER<\/span><\/p>\n<\/blockquote>\n


\n

 <\/p>\n

FLOAT
\n<\/strong>Float numbers are similar to integer just because they’re numbers too, but FLOAT allow you to use decimal numbers and this open a new world, because just imagine try to work with numbers like \u03c0<\/span> or ‘e’ and use INTEGERS… it won’t work right?<\/span><\/p>\n

\"istock_pi_daysmall\"<\/p>\n

As equal as INTEGER, FLOAT numbers can be used in mathematical operations.<\/span><\/p>\n

\n

>>>1.2+5.1<\/span>
\n6.3<\/span><\/p>\n<\/blockquote>\n

Also the float numbers can be also be assign to a variable or an input. <\/span><\/p>\n

\n

>>>num_Float = 3<\/span><\/p>\n

#The first number is a variable that has the value of 3<\/span><\/p>\n

>>>input_Float= int(input(‘Give me a number’))<\/span><\/p>\n

#The second ask for the user to put a number and covert it to FLOAT
\n<\/span><\/p>\n<\/blockquote>\n


\n

 <\/p>\n

STRINGS
\n<\/strong>Strings are a very special type in Python because if you are familiar with other programming languages maybe you know that strings are not objects, but here in Python THEY ARE!
\n<\/span><\/p>\n

\"comillas\"<\/p>\n

So you can use a string like a object and make a lot of things with it.<\/span><\/p>\n

\n

>example_string = ‘Hi everyone!’<\/span>
\n>>>example_string<\/span>
\nHi everyone!<\/span>
\n>>>len(example_string)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #Length of the string<\/span>
\n5<\/span>
\n>>>type(example_string)\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 #Type of the class<\/span>
\n<class ‘str’><\/span><\/p>\n<\/blockquote>\n

Python String Official Reference<\/a><\/p>\n


\n

 <\/p>\n

TUPLES
\n<\/strong>Tuples are a special type of ordered list in Python 3, because with Tuples you can make a list but you can’t modify it,\u00a0 it remains always the same.
\n<\/span><\/p>\n

To make a tuple the process is the following (very simple):<\/span><\/p>\n

\n

>>>example_Tuple = 1,2,3<\/span>
\n>>>type(example_Tuple)
\n<\/span><class ‘tuple’><\/span><\/p>\n<\/blockquote>\n

To create a tuple just type the elements without any bracket or keys!<\/span><\/p>\n

But why use tuples if they can’t be edited?<\/span>
\nWell sometimes even if you don’t believe me Tuples are necessary just imagine for example that you are in charge of many schools of a region and you really don’t want to miss information, does a tuple can be useful?…
\n<\/span>
\nOf course because this way you secure the fact that any school name will be missed.<\/span><\/p>\n

Python Tuples Official Reference<\/a><\/p>\n


\n

 <\/p>\n

LISTS<\/strong>
\nList are amazing, as its name says it is a ordered list of things like Tuples but LIST CAN BE EDITED.<\/span><\/p>\n

To make a list is very simple:<\/span><\/p>\n

\n

>>example_List = [1, 2, 3]<\/span>
\n>>>type(example_List)<\/span>
\n<class ‘list’><\/span>
\n#in Lists you can add [use list.append(x)]
\n>>>example_List.append(4)
\n>>>example_List
\n[1, 2, 3, 4]<\/span><\/p>\n

#in Lists you can remove [use list.remove(x) or list.pop(x)]<\/span>
\n>>>example_List.remove(3)<\/span>
\n>>>example_List<\/span>
\n[1, 2, 4]<\/span><\/p>\n

#In Lists you can move elements inside and outside [use list.insert(x,y)]<\/span>
\n>>>example_List.insert(2,3) #In second space insert number 3<\/span>
\n>>>example_List<\/span>
\n[1, 2, 3, 4]<\/span><\/p>\n<\/blockquote>\n

Lists are very useful when you know how to use it, because it can help you with stacks and also when you are open a file in Python<\/span><\/p>\n

Python3 Lists Official Reference<\/a><\/span><\/p>\n

DICTIONARIES<\/strong>
\nDictionaries are a link between anything and anything, they are very useful because it keep order the information, and provides different uses.
\n<\/span><\/p>\n

To make a dictionary follow the following example:<\/p>\n

\n

>>family_Age = {‘Me’:18, ‘Sister’:24, ‘Mom’:50, ‘Dad’:55}
\n>>>type(family_Age)
\n<class ‘dict’><\/p>\n

#If you call a specific element it return the value
\n>>>family_Age[‘Mom’]50<\/p>\n

#You can add elements very simple
\n>>>family_Age[‘Uncle’]=47
\n>>>family_Age
\n{‘Me’:18, ‘Sister’:24, ‘Mom’:50, ‘Dad’:55, ‘Uncle’:47}<\/p>\n

#Also delete
\n>>>del family_Age[‘Me’]
\n>>>family_Age
\n{‘Sister’:24, ‘Mom’:50, ‘Dad’:55, ‘Uncle’:47}<\/p>\n<\/blockquote>\n

Dictionaries are very useful for several things,\u00a0 if you want to know more about click the following link.<\/p>\n

Python Dictionaries Official Reference<\/a><\/p>\n

\"\"<\/a> <\/p>\n","protected":false},"excerpt":{"rendered":"

Hi in Python 3 we have 6 Basic Types for categorize things, let me show you: In Python 3 we have: INTEGERS We can say an ‘integer’ is an integer, some examples of this could be: 1, 23, 3909, -23, 4, -189 Unlike other programming languages python use Integers not matter how high or small…
Continue reading →<\/span><\/a>\"\"<\/p>\n","protected":false},"author":196,"featured_media":26983,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,3],"tags":[372,46],"_links":{"self":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/26987"}],"collection":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/users\/196"}],"replies":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/comments?post=26987"}],"version-history":[{"count":1,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/26987\/revisions"}],"predecessor-version":[{"id":26988,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/posts\/26987\/revisions\/26988"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media\/26983"}],"wp:attachment":[{"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/media?parent=26987"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/categories?post=26987"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kenscourses.com\/tc101fall2015\/wp-json\/wp\/v2\/tags?post=26987"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}