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
‘#Mastery17’ Articles at TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Thu, 26 Nov 2015 05:06:44 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ #Mastery7 and #Mastery17 #TC1017 https://kenscourses.com/tc101fall2015/2015/mastery7-and-mastery17-tc1017/ Thu, 26 Nov 2015 05:06:44 +0000 https://eduardotorresb.withknown.com/2015/mastery7-and-mastery17

Link

and

]]>
https://creativecommons.org/licenses/by/4.0/
#Mastery17 https://kenscourses.com/tc101fall2015/2015/mastery17-7/ Thu, 26 Nov 2015 04:06:15 +0000 http://jsphsalazar.wordpress.com/?p=169 ]]> This is very similar than the last one, but with the difference is that with elif we can evaluate more than 2 conditions

For example:

aqq

I’m using the same example but the elif is included.

 

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery15 & Mastery16 & Mastery17 https://kenscourses.com/tc101fall2015/2015/mastery15-mastery16-mastery17/ Thu, 26 Nov 2015 01:22:14 +0000 http://5nbppkkyj.wordpress.com/?p=184 ]]> Conditionals are generally a way to check something. The classic “if” example is easy to understand. The syntax helps you understand it a bit. A normal if statement would look like this:

if(condition):

do something
Let’s see an example with food because I’m hungry. My code will basically ask if the food is ready by having the user input dictate its state of readiness (that explains the variable name) and then my conditional if checks the data to perform an action, it prints “yay” if the food is ready. But the operator = helps me know if the user input is right. We can evaluate other values by using other operators such as < > to compare values.
readiness = input(“Is the food ready? “)

if(readiness == “yes”):

print(“yay”)
We can also combine two conditionals in an if statement by using the Boolean operation and. I added a new value which is my food temperature so my conditional are always met and my if statement will work.
readiness = input(“Is the food ready? “)

temperature = input(“Is the food hot? “)

if(readiness == “yes”) and (temperature == “yes”):

print(“yay”)
The same can be done with the operation or. What or does is it basically combines two conditionals and the action will be executed if either conditions are met. So in this case it doesn’t matter if our readiness or temperature are not hot or ready if one of them is true our action will be executed.
readiness = input(“Is the food ready? “)

temperature = input(“Is the food hot? “)

if(readiness == “yes”) or (temperature == “yes”):

print(“yay”)
So my values were checked and my program acted accordingly. But what if the value is not what I asked for? There is an operator called else that solves this problem. In this case, else doesn’t have to include a condition because we don’t care about anything else, we just want to have our food right? All I have to do is write else below my if statement without an indentation and tell my else what to do.
readiness = input(“Is the food ready? “)

if(readiness == “yes”):

print(“yay”)

else:

print(“hurry up, I’m hungry”)
There is another conditional that is a mixture of else and if and it must be typed between your if and else. It is called elif. It basically sets up another conditional so it is a lot more like it but it is still like else.
readiness = input(“Is the food ready? “)

if(readiness == “yes”):

print(“yay”)

elif(readiness == “yep”):

print(“yay”)

else:

print(“hurry up, I’m hungry”)

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery #17 https://kenscourses.com/tc101fall2015/2015/mastery-17-12/ Wed, 25 Nov 2015 22:47:44 +0000 http://estebanpg.wordpress.com/?p=80

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 17: Use of “switch” as a conditional https://kenscourses.com/tc101fall2015/2015/mastery-17-use-of-switch-as-a-conditional-3/ Wed, 25 Nov 2015 22:36:47 +0000 http://samanthariverac.wordpress.com/?p=306 Here is the video: https://youtu.be/y_x2daj04qo

Thanks for watching !!!

]]>
https://creativecommons.org/licenses/by/4.0/
Use of ‘elif’ and ‘else’ Python3 https://kenscourses.com/tc101fall2015/2015/use-of-elif-and-else-python3/ Wed, 25 Nov 2015 21:38:12 +0000 http://asimplemaniseepythonipresslike.wordpress.com/?p=345 Mastery about how to use elif and else! watch it!

]]>
https://creativecommons.org/licenses/by/4.0/
Masteries #17 and #21 https://kenscourses.com/tc101fall2015/2015/masteries-17-and-21/ Wed, 25 Nov 2015 20:45:58 +0000 http://dragv.wordpress.com/?p=158 ]]> Here’s my video of me explaining masteries#17 and #21.

Enjoy.

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery17 https://kenscourses.com/tc101fall2015/2015/mastery17-6/ Wed, 25 Nov 2015 10:12:34 +0000 http://ivancortes96.wordpress.com/?p=119 ]]>
  • Use of “switch” as a conditional
  • Here is the link to my video:

    ]]>
    https://creativecommons.org/licenses/by/4.0/
    Mastery 17 https://kenscourses.com/tc101fall2015/2015/mastery-17-11/ Wed, 25 Nov 2015 08:38:41 +0000 http://andreandradec.wordpress.com/?p=354

    ]]>
    https://creativecommons.org/licenses/by/4.0/
    Mastery 17 https://kenscourses.com/tc101fall2015/2015/mastery-17-10/ Wed, 25 Nov 2015 03:24:08 +0000 http://opezaimd.tumblr.com/post/133904163660 On this mastery I’ll show you what and how to use the conditional switch in C++.

    Switch is a statement that tests a variable for equality in a list of given conditions. It is somehow a summarized version of IF when you have a lot of conditions. 

    This flow chart may help you understand better, and this webpage too:

    The default syntax of switch goes like this:

    switch (expression)
    case “condition” : outcome
    [default:statement]    //This is used when the variable input isn’t a valid option.

    So, for the purpose of this mastery, lets create a program were the user can input his points on masteries so far and tell him if his good or screwed. Do as follows:

    1. Create our “basic” program.
    2. Inside the int, declare a char variable with an assigned value.
    3. Use switch to condition the outcome and tell the user if his good or screwed.

    Your program should look something like this:

    Now let’s test it:

    Let’s just play with another value:

    Great! Now you know what and how to use switch conditional.

    ]]>
    On this mastery I’ll show you what and how to use the conditional switch in C++.

    Switch is a statement that tests a variable for equality in a list of given conditions. It is somehow a summarized version of IF when you have a lot of conditions. 

    This flow chart may help you understand better, and this webpage too:

    The default syntax of switch goes like this:

    switch (expression)
    case “condition” : outcome
    [default:statement]    //This is used when the variable input isn’t a valid option.

    So, for the purpose of this mastery, lets create a program were the user can input his points on masteries so far and tell him if his good or screwed. Do as follows:

    1. Create our “basic” program.
    2. Inside the int, declare a char variable with an assigned value.
    3. Use switch to condition the outcome and tell the user if his good or screwed.

    Your program should look something like this:

    Now let’s test it:

    Let’s just play with another value:

    Great! Now you know what and how to use switch conditional.

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