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
‘#Mastery16’ Articles at TC101 Fall 2015 https://kenscourses.com/tc101fall2015 Introduction to Programming Python and C++ Thu, 26 Nov 2015 05:09:28 +0000 en hourly 1 https://creativecommons.org/licenses/by/4.0/ #Mastery15 #Mastery16 y #Mastery18 #TC1017 https://kenscourses.com/tc101fall2015/2015/mastery15-mastery16-y-mastery18-tc1017/ Thu, 26 Nov 2015 05:09:28 +0000 https://eduardotorresb.withknown.com/2015/mastery15-mastery16-y-mastery18

Link

y

]]>
https://creativecommons.org/licenses/by/4.0/
#Mastery16 https://kenscourses.com/tc101fall2015/2015/mastery16-2/ Thu, 26 Nov 2015 04:01:48 +0000 http://jsphsalazar.wordpress.com/?p=166 ]]> You can use else statement when you have two conditions and the first one is false so the condition continues with the else until it gets true.

Here’s an example:

aq

As you can see if z = 98, the first condition is not true, so the program will print the else statement.

 

]]>
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 15 y 16 https://kenscourses.com/tc101fall2015/2015/mastery-15-y-16-4/ Wed, 25 Nov 2015 22:45:07 +0000 http://estebanpg.wordpress.com/?p=77

]]>
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/
Use of the conditional “if” and Use of “else” with a conditional https://kenscourses.com/tc101fall2015/2015/use-of-the-conditional-if-and-use-of-else-with-a-conditional-3/ Wed, 25 Nov 2015 18:42:02 +0000 http://juanmele.wordpress.com/?p=127 Here is the link and video to youtube to see this Mastery

]]>
https://creativecommons.org/licenses/by/4.0/
Mastery 15 and 16 https://kenscourses.com/tc101fall2015/2015/mastery-15-and-16/ Wed, 25 Nov 2015 09:14:34 +0000 http://ivancortes96.wordpress.com/?p=112 ]]>
  • Use of the conditional “if”
  • Use of “else” with a conditional
  • Here is the link to my video:

    ]]>
    https://creativecommons.org/licenses/by/4.0/
    Masteries 15 & 16 https://kenscourses.com/tc101fall2015/2015/masteries-15-16-7/ Mon, 23 Nov 2015 14:32:44 +0000 http://hrglez.wordpress.com/?p=295 ]]>

    Use of the conditional “if”

    Use of “else” with a conditional

    ]]>
    https://creativecommons.org/licenses/by/4.0/
    Mastery 15 y 16 https://kenscourses.com/tc101fall2015/2015/mastery-15-y-16-2/ Fri, 30 Oct 2015 23:53:25 +0000 http://fernyalanis.wordpress.com/?p=67

    ]]>
    https://creativecommons.org/licenses/by/4.0/
    MASTERY 16 – Else conditional https://kenscourses.com/tc101fall2015/2015/mastery-16-else-conditional/ Fri, 30 Oct 2015 22:48:18 +0000 http://ilkapython.wordpress.com/?p=119

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