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
‘#a’ Articles at Courses by Ken https://kenscourses.com/tc101winter2015 Facilitator of Learning Experiences Thu, 07 May 2015 03:33:23 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ #mastery24 Creation and use of tuples in Python https://kenscourses.com/tc101winter2015/2015/mastery24-creation-and-use-of-tuples-in-python-2/ Thu, 07 May 2015 03:33:23 +0000 https://gilrg18.withknown.com/2015/mastery24-creation-and-use-of-tuples-in-python

A tuple is an unchangeable sequence of values.

x=("Gilberto",18,"ISC")   tuple is written with ()

When you do this you create a tuple with three elements. You can access these elements individually by typing the variable and the then inside brackets directly to the right of the variable type the number of the element to which you are referring.

print (x[o])

>>>Gilberto

Python starts numbering at 0 so Gilberto=0,18=1 and ISC = 2

Packing and Unpacking:

In tuple packing, the values on the left are ‘packed’ together in a tuple:

x=("Gilberto",18,"ISC")

In tuple unpacking, the values in a tuple on the right are ‘unpacked’ into the variables/names on the right:

x=("Gilberto",18,"ISC")

(Name,Age,Studies) = x

print(Name,Age,Studies)

>>>Gilberto 18 ISC

Sources for info. about tuples: Link

 

1014

24

Gilberto Rogel García

Continue reading ]]>

A tuple is an unchangeable sequence of values.

x=(“Gilberto”,18,”ISC”)   tuple is written with ()

When you do this you create a tuple with three elements. You can access these elements individually by typing the variable and the then inside brackets directly to the right of the variable type the number of the element to which you are referring.

print (x[o])

>>>Gilberto

Python starts numbering at 0 so Gilberto=0,18=1 and ISC = 2

Packing and Unpacking:

In tuple packing, the values on the left are ‘packed’ together in a tuple:

x=(“Gilberto”,18,”ISC”)

In tuple unpacking, the values in a tuple on the right are ‘unpacked’ into the variables/names on the right:

x=(“Gilberto”,18,”ISC”)

(Name,Age,Studies) = x

print(Name,Age,Studies)

>>>Gilberto 18 ISC

Sources for info. about tuples: Link

 

1014

24

Gilberto Rogel García

]]>
https://creativecommons.org/licenses/by/4.0/
#Mastery08 https://kenscourses.com/tc101winter2015/2015/mastery08-2/ Wed, 18 Feb 2015 20:24:04 +0000 http://venkonprogram.withknown.com/2015/mastery08 Continue reading ]]>

Python conventions (Zen of Python)

https://www.python.org/dev/peps/pep-0008/

Coding conventions are rules that were created by programers to make people’s life easier when reading a code. 

These conventions were created in order to have a better style when programming and that way, make the code easier to understand. 

Coding conventions include:

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