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/feed-rss2.php on line 8
‘#mastery09’ Articles at TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Thu, 26 Nov 2015 01:46:31 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ Mastery09 https://kenscourses.com/tc101fall2015/2015/mastery09-4/ Thu, 26 Nov 2015 01:46:31 +0000 http://5nbppkkyj.wordpress.com/?p=270 ]]> Basic types and their use in Pythonintegers 

Whole numbers from negative infinity to infinity, such as 1, 0, -5, etc.

Integers or any number negative or positive without decimals can be assigned variables. You can name them anything. You can work with integers directly or assign them to variables. By work I mean you can add them, subtract them, multiply them, divide them, use parenthesis which is useful for order of operations and you can also call calculate powers and remainders. Retainers are cool because they are useful for loops and other operations. Power values are cool because they can also be used in square roots. So in a few words, standard math operations with some useful twists.

float 

Float means “floating point number,” any rational number, usually used with decimals such as 2.8 or 3.14159.

When you do math with integers, your computer interprets values as integers so you will never get a float unless you specify it. To specify, you can just add a decimal point or you can write whatever number “n” like this “float(n)”. When you do math with floats, your result will always be a float. It is important to note that when you mix strings and floating points, Python will always return a float. 

You can also turn a float into a integer value using “int(4.0)”

strings 

A set of letters, numbers, or other characters (!,&,%,#). 

Strings are sequential collections, so items in the collections are ordered.

Depending on which version of Python you are using, strings will be inside single(”) or double quotation marks (“”). In Python 3 strings will also be inside quotation marks and those quotation marks will be inside parenthesis. Strings can also be added (like integers and floats) using +’s or commas, this is called concatenation.

They can be assigned as a value to add or print or both. Integers and characters can be converted into strings by using str(). 

lists 

 x=[1,2,3]  

look at the square brackets!

Lists are sequential collections, so items in the collections are ordered.

 Sometimes regarded as the most powerful data structures in Python while simply being sequences of stuff. You can call them “x” or “sushi”, so when you run it its elements will be used. You can evaluate each element of the list by calling x knowing the position of the element you need. You can also change an specific element of your list, mixing data types and putting other lists within your list. Variables are your friend, a new variable “pizza” can refer to your existing variable “x” which has your list and make changes on your elements (as well as other useful things). To copy lists, not refer to them, you can write pizza = x[:]. This specifies which elements you want to have and copies them, this notation is cool because it lets you choose a range (from up to but not including). 

tuples 

Tuples are sequential collections, so items in the collections are ordered.

A list with a fixed number of elements. ie x=(1,2,3) parentheses makes it a tuple.

Tuples are created the same way lists are that is, they are declared like this x=(). In Python Tuples are generally seen as a clean way of storage since they are memory efficient and not adjustable but this advantage can also be seen as inflexible 

dictionaries 

A type with multiple elements i.e. x = {1: ‘a’,’b’: 2,3: 3} where you address the elements with, e.g., a text.

Dictionaries basically bind a key to a value,. One of its characteristics is their lack of order in sorting data, so dictionaries are not sequential collections like lists, strings and tuples. Some of the possible values in dictionaries can be range from lists to functions. To create a dictionary you can do the following x = {}. To reference a value in the dictionary you can print it by calling they key so 

using the example above, if you print x[1] you will get the value of the key 1 which is “a”.

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 08 & 09 https://kenscourses.com/tc101fall2015/2015/mastery-08-09/ Tue, 24 Nov 2015 01:59:46 +0000 http://davidg2897.wordpress.com/?p=196 ]]> Mastery 08 – The Zen of Python

Here’s the Zen of Python running inside my shell.

Capture

Mastery 09 – Basic type and their use in Python

Python has 6 different basic types of data. They are:

  1. Integers
    These are numbers that belong to all the real numbers.
    Capture
  2. Floating point numbers
    These are all the real numbers that use decimals.
    Capture
  3. Strings
    These are a set of letters, numbers or any other character. They are inbetween quotation marks (“”).
    Capture
  4. Tuples
    This is an ordered set of  values with fixed number of elements, goes inbetween parentheses.
  5. Lists
    This is an ordered set of values without fixed number of elements, goes inbetween brackets.Capture
  6. Dictionaries
    This is a type with different elements, used to map keys to their assigned values. They keys and values can be of any type.
    Capture

]]>
https://creativecommons.org/licenses/by/4.0/
MASTERY9 https://kenscourses.com/tc101fall2015/2015/mastery9-3/ Mon, 23 Nov 2015 01:24:23 +0000 http://luiscortestec.wordpress.com/?p=128 I KNOW WICH ARE THE TYPES IN PYTHON 3

HERE IS AN EXAMPLE WHERE I CONVERT AN STRING INTO AN INTEGER:

Captura de pantalla 2015-11-22 a las 7.22.51 p.m.

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery Number 9 https://kenscourses.com/tc101fall2015/2015/mastery-number-9/ Thu, 29 Oct 2015 03:28:00 +0000 http://choza973.wordpress.com/?p=84 ]]> I rushed this video since it’s kinda long and i screwed up while recording the first time, but there’s the code with comments and the results.

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 9 – Basic types and their use in C++ https://kenscourses.com/tc101fall2015/2015/mastery-9-basic-types-and-their-use-in-c-3/ Thu, 29 Oct 2015 02:37:08 +0000 http://andreandradec.wordpress.com/?p=199

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery09 https://kenscourses.com/tc101fall2015/2015/mastery09-2/ Wed, 28 Oct 2015 19:28:41 +0000 https://octavioirg.wordpress.com/?p=117 ]]> Basic Types and their use in C++

CC licensed photo by Victoria Pickering on Flickr.
CC licensed photo by Victoria Pickering on Flickr.

While programming we need to use different type of information and for each single class of data that we want to produce or to store there is a Data Type in a programming language. One basic principle to understand is that storing a letter is different from storing a number, or a decimal or a word, o a set of numbers. For all this types of data C++ has a way to store them in memory and perform transformations to the values. Those places are called variables and a variables is nothing weird, it’s just a place in memory where the programm saves something (say a word, or a single letter, or a number, etc).

While programming we need to use different type of information and for each single class of data that we want to produce or to store there is a Data Type in a programming language. One basic principle to understand is that storing a letter is different from storing a number, or a decimal or a word, o a set of numbers. For all this types of data C++ has a way to store them in memory and perform transformations to the values. Those places are called variables and a variables is nothing weird, it’s just a place in memory where the programm saves something (say a word, or a single letter, or a number, etc).

The following table presents the types and how they are called in C++

Type Keyword
Boolean bool
Character char
Integer int
Floating point float
Double floating point double
Valueless void
Wide character wchar_t

It’s interesting that you can modify some of this types by ading words like signed, unsigned, short and long. For example: unsigned int is a variable that can only store interger with no sign thus, only positive intergers.

In the next video (I will upload it later to day) I will explain the use of 4 data types:

int, char, bool and float.

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery09 https://kenscourses.com/tc101fall2015/2015/mastery09-3/ Wed, 28 Oct 2015 19:28:41 +0000 http://octavioirg.wordpress.com/?p=117 ]]> Basic Types and their use in C++

CC licensed photo by Victoria Pickering on Flickr.
CC licensed photo by Victoria Pickering on Flickr.

While programming we need to use different type of information and for each single class of data that we want to produce or to store there is a Data Type in a programming language. One basic principle to understand is that storing a letter is different from storing a number, or a decimal or a word, o a set of numbers. For all this types of data C++ has a way to store them in memory and perform transformations to the values. Those places are called variables and a variables is nothing weird, it’s just a place in memory where the programm saves something (say a word, or a single letter, or a number, etc).

While programming we need to use different type of information and for each single class of data that we want to produce or to store there is a Data Type in a programming language. One basic principle to understand is that storing a letter is different from storing a number, or a decimal or a word, o a set of numbers. For all this types of data C++ has a way to store them in memory and perform transformations to the values. Those places are called variables and a variables is nothing weird, it’s just a place in memory where the programm saves something (say a word, or a single letter, or a number, etc).

The following table presents the types and how they are called in C++

Type Keyword
Boolean bool
Character char
Integer int
Floating point float
Double floating point double
Valueless void
Wide character wchar_t

It’s interesting that you can modify some of this types by ading words like signed, unsigned, short and long. For example: unsigned int is a variable that can only store interger with no sign thus, only positive intergers.

In the next video I will explain the use of 2 data types:

char and bool.


]]>
https://creativecommons.org/licenses/by/4.0/
#Masteries 9 and 13 https://kenscourses.com/tc101fall2015/2015/masteries-9-and-13/ Wed, 28 Oct 2015 01:16:14 +0000 https://manuelgodm.wordpress.com/?p=78 ]]> Mastery 9. Basic types and their use in C++…

Mastery 13. Importing and using C++ libraries…

And here my video:

]]>
https://creativecommons.org/licenses/by/4.0/
#Masteries 9 and 13 https://kenscourses.com/tc101fall2015/2015/masteries-9-and-13-4/ Wed, 28 Oct 2015 01:16:14 +0000 http://manuelgodm.wordpress.com/?p=78 ]]> Mastery 9. Basic types and their use in C++…

Here you can find some information about the basic types in C++

http://www.cplusplus.com/doc/tutorial/variables/

This is a great website to learn C++

Fundamental data types

Picture taken from http://www.cplusplus.com/

Mastery 13. Importing and using C++ libraries…

You can find more information about libraries in those website:

http://www.cplusplus.com/reference/clibrary/

Libraries and its functions: http://cbasesdedatos.blogspot.mx/

Declaration and use of libraries: https://www.programarya.com/Cursos/C++/Bibliotecas-o-Librerias

And here my video:

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 9 – Basic types https://kenscourses.com/tc101fall2015/2015/mastery-8-basic-types/ Tue, 27 Oct 2015 15:05:00 +0000 http://kenscourses.com/tc101fall2015/?guid=1df08c92f6d0f77daa5e2c68b099e58c

- Integers

 An integer number
x = 7
x + 3 = 10
It canbe used for calculations

- Floats

It´s a decimal number
x = .7 
1.4456
0.1234

- Strings

Is a word, you need to tell pyhton that you are writing a string and not a variable with "
x = "Hello World"
It can be added to integers and other strings
print (x,"I´m jose carlos and im",18,"years old")
Hello World I´m jose calros and im 18 years old

-Tuples

An uneditable list, to make one you need to use parenthesis
x = (1,2,3)

-Lists

A list that can me edited, to make one you need to use brackets
x = [6,1,9,"hola","hello"]

-Dictionaries 

You link elements with other type, you create one with {} and link each element with :, it is comonly used to map strings to integers.
x = {"hola":1,"jose":2, 15:15,"new word":0}

You can modify the type of a variable with preset functions, sometimes it doesnt work
x = 12
str(x)
"12"
x = "hola"
int(x)
Error

]]>
Here im going to prove that i know the basic types of Python.

– Integers

 An integer number
x = 7
x + 3 = 10
It canbe used for calculations

– Floats

It´s a decimal number
x = .7 
1.4456
0.1234

– Strings

Is a word, you need to tell pyhton that you are writing a string and not a variable with “
x = “Hello World”
It can be added to integers and other strings
print (x,”I´m jose carlos and im”,18,”years old”)
Hello World I´m jose calros and im 18 years old

-Tuples

An uneditable list, to make one you need to use parenthesis
x = (1,2,3)

-Lists

A list that can me edited, to make one you need to use brackets
x = [6,1,9,”hola”,”hello”]

-Dictionaries 

You link elements with other type, you create one with {} and link each element with :, it is comonly used to map strings to integers.
x = {“hola”:1,”jose”:2, 15:15,”new word”:0}

You can modify the type of a variable with preset functions, sometimes it doesnt work
x = 12
str(x)
“12”
x = “hola”
int(x)
Error

]]>
https://creativecommons.org/licenses/by/4.0/