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
‘#awesome’ Articles at Courses by Ken https://kenscourses.com/tc101winter2015 Facilitator of Learning Experiences Mon, 27 Apr 2015 16:11:22 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ WSQ13 – Babylonian method https://kenscourses.com/tc101winter2015/2015/wsq13-babylonian-method-10/ Mon, 27 Apr 2015 16:11:22 +0000 https://tc1014.withknown.com/2015/wsq13---babylonian-method Continue reading ]]>

the babylonian method consists in guessing the closest value to the square root of one number and use it to get closer to the real root.

reference: http://mathlesstraveled.com/2009/05/18/square-roots-with-pencil-and-paper-the-babylonian-method/

my code github: https://github.com/nazare52/progra/blob/master/wsq13.py

]]>
https://creativecommons.org/licenses/by/4.0/
Quiz10 https://kenscourses.com/tc101winter2015/2015/quiz10-2/ Thu, 23 Apr 2015 16:21:46 +0000 https://tc1014.withknown.com/2015/quiz10 Continue reading ]]>

github

https://github.com/nazare52/Quiz10

]]>
https://creativecommons.org/licenses/by/4.0/
Quiz09 https://kenscourses.com/tc101winter2015/2015/quiz09-15/ Mon, 20 Apr 2015 03:53:54 +0000 https://tc1014.withknown.com/2015/quiz09 Continue reading ]]>

partial 2 revised.

github repository:

https://github.com/nazare52/Quiz09-Parcial-2

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery19 – While loop https://kenscourses.com/tc101winter2015/2015/mastery19-while-loop/ Fri, 10 Apr 2015 02:23:46 +0000 https://tc1014.withknown.com/2015/mastery19---while-loop Continue reading ]]>

the while loop will go on until the condition to break it is met and can run undefinedly.

to use it write while and the condition>

while x < 50:

         do something

reference:

https://wiki.python.org/moin/WhileLoop

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery18 – Nesting of conditional statements https://kenscourses.com/tc101winter2015/2015/mastery18-nesting-of-conditional-statements-3/ Fri, 10 Apr 2015 00:33:02 +0000 https://tc1014.withknown.com/2015/mastery18---nesting-of-conditional-statements Continue reading ]]>

nesting is when you put conditionals inside other ones to check another condition. 

if something:

            thing1

            if something2:

                         this

             else:

                       that

there is an if and else conditionals inside the initial if.

reference:

http://www.tutorialspoint.com/python/nested_if_statements_in_python.htm

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery17 – Conditional elif https://kenscourses.com/tc101winter2015/2015/mastery17-conditional-elif/ Tue, 31 Mar 2015 20:19:09 +0000 https://tc1014.withknown.com/2015/mastery15---conditional-elif Continue reading ]]>

the elif conditional es a combination of the else and if conditionals, it needs a to fulfill a conition like the if conditional but it will be ignored if the condition above is fulfilled like an else conditional.

if we had this conditionals:

if x != 0:

   print(“it’s not a 0”)

if x > 0:

   print(“more than 0”)

if x < 100:

   print(“less than 100”)

and we used 50 as x, the program will print everything since 50 meets each condition but if we change any of the if conditionals after the first to elif the program would ignore them since the first will be true. elif is to stick two statements as one.

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery16 – Conditional else https://kenscourses.com/tc101winter2015/2015/mastery16-conditional-else/ Tue, 31 Mar 2015 19:21:22 +0000 https://tc1014.withknown.com/2015/mastery16---conditional-else Continue reading ]]>

the else conditional goes after an if conditional, when none of the conditionals above is fulfilled then the else conditon is used. for example:

x = 5

if x < 5:

if x > 5:

else:

    print (“it’s a 5”)

the rpogram wil ignore the other conditionals since 5 is not lower or higher than 5 and will use the else.

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery15 – Conditional If https://kenscourses.com/tc101winter2015/2015/mastery15-conditional-if/ Tue, 31 Mar 2015 19:07:40 +0000 https://tc1014.withknown.com/2015/mastery15---conditional-if Continue reading ]]>

the conditional if es used whe you want something to happen only when a a certain condition is met. like comparing two variables and if they are equal the the program will follow the contition.

x = input()

y = input()

if x == y:

    print (“it is the same”)

 

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery14 – Creating a python module https://kenscourses.com/tc101winter2015/2015/mastery14-creating-a-python-module/ Tue, 31 Mar 2015 05:01:54 +0000 https://tc1014.withknown.com/2015/mastery14---creating-a-python-module Continue reading ]]>

creating a module is no different from a normal program, create a python file and create a few functions in it.

file name: mymodule.py

def function1():

      print (“function 1”)

# end of the module.

and in another program import it an call the function:

import mymodule.py

mymodule.function1()

reference:

http://www.ibiblio.org/g2swap/byteofpython/read/making-modules.html

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery13 – Importing and using python modules https://kenscourses.com/tc101winter2015/2015/mastery13-importing-and-using-python-modules-3/ Tue, 31 Mar 2015 04:14:08 +0000 https://tc1014.withknown.com/2015/mastery13---importing-and-using-python-modules Continue reading ]]>

to import modules write import and the name of the module you want.

import random

and now you can use the functions of that module.

here is a list of modules in python:

https://docs.python.org/3/py-modindex.html

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