Warning: The magic method Slickr_Flickr_Plugin::__wakeup() must have public visibility in /home/kenbauer/public_kenscourses/tc101winter2015/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/tc101winter2015/wp-content/plugins/slickr-flickr/classes/class-plugin.php:152) in /home/kenbauer/public_kenscourses/tc101winter2015/wp-includes/feed-rss2.php on line 8
‘#quiz0’ Articles at Courses by Ken https://kenscourses.com/tc101winter2015 Facilitator of Learning Experiences Thu, 07 May 2015 03:10:13 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ #mastery09 Basic types and their use in Python https://kenscourses.com/tc101winter2015/2015/mastery09-basic-types-and-their-use-in-python-2/ Thu, 07 May 2015 03:10:13 +0000 https://gilrg18.withknown.com/2015/mastery09-basic-types-and-their-use-in-python

Types are a category for things within Python with which Python will work. Types are integers,float,strings,tuples,lists and dictionaries.

Integers 

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

Integers are numeric values and can be stored, manipulated, and expressed inside variables without quotes.

Example: 

x=5

print (x)

>>>5

Float

Short for "floating point number," any rational number, usually used with decimals such as 2.8 or 3.14159.

Strings 

A set of letters, numbers, or other characters.

Strings are a type. They are the basic unit of text in Python and all the other types except integers may contain strings.

Example:

x="Hello World"

print (x) 

>>>Hello World

Tuples 

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

A tuple is an unchangeable sequence of values.

Example:

x = ("element 1", "element 2", "element 3")

Lists

A list is a changeable sequence of data. A list is contained by square brackets i.e. [1,2,3]

Example:

x=[1,2,3]

print (x)

>>>[1,2,3]

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.

Example:

x={'Hello':'hola', 'Bye':'adios'}

 

print(x)

>>> {'Hello':'hola', 'Bye':'adios'}

Source with more info.: http://en.wikiversity.org/wiki/Python/Basic_data_types#quiz0

1014

09

Gilberto Rogel García

 

 

Continue reading ]]>

Types are a category for things within Python with which Python will work. Types are integers,float,strings,tuples,lists and dictionaries.

Integers 

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

Integers are numeric values and can be stored, manipulated, and expressed inside variables without quotes.

Example: 

x=5

print (x)

>>>5

Float

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

Strings 

A set of letters, numbers, or other characters.

Strings are a type. They are the basic unit of text in Python and all the other types except integers may contain strings.

Example:

x=”Hello World”

print (x) 

>>>Hello World

Tuples 

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

A tuple is an unchangeable sequence of values.

Example:

x = (“element 1”, “element 2”, “element 3”)

Lists

A list is a changeable sequence of data. A list is contained by square brackets i.e. [1,2,3]

Example:

x=[1,2,3]

print (x)

>>>[1,2,3]

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.

Example:

x={‘Hello’:’hola’, ‘Bye’:’adios’}

 

print(x)

>>> {‘Hello’:’hola’, ‘Bye’:’adios’}

Source with more info.: http://en.wikiversity.org/wiki/Python/Basic_data_types#quiz0

1014

09

Gilberto Rogel García

 

 

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