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
‘#mastery22’ Articles at TC101 Fall 2015, Page 2
Introduction to Programming Python and C++

Tag Archives: #mastery22

Types of repetition #Mastery22

This mastery is related to the different types of repetition and in which cases they are recommended.

In this video I talk about while, do while, for and recursion: http://youtu.be/n1aKtTZ4Smg?hd=1

Also, I uploaded a video for the for loop, here’s a link to the blog post: https://interestingstuff.withknown.com/2015/loops-20-mastery20-mastery21

Mastery 22 – Types of repetition

There are 3 types of repetition:
-For loop
-While loop
-Recursion

The FOR loop is used when you know the number of repetitions. It can be used with ranges, list tuples or dictionaries(iterable objects).  It takes a value inside the object, work with it, and then do the same thing with the next value until the iterable object is finished.

The WHILE loop is used when you dont how the number of repetitons. It works with a condition and it will repeat until the condition is false.

Recursion is when you call a function inside the same function. It can be used in special cases where you need to take a value from the function itself, this job can be done with FOR or WHILE loops but it´s shorter to write a recursion.

#Masteries 21 & 22

Mastery 21. Use of recursion for repetitive algorithms… Mastery 22. When to use what type of repetition in a program… And here my video:

This is mastery #22 explains when to use which type of…

This is mastery #22 explains when to use which type of repetition.

While: 

Now we start from zero,

and don’t try to be a hero,

repeats something as long as you want,

with that I’ll give you a hand.

You have to use a condition, 

if you want it could be addition, 

be careful because infinite it is, 

and of eaten cake it’s a piece.

For:

If you don’t wanna repeat that much,

this will help you, I have a hunch,

you just set a little parameter,

it’s not like running a kilometer.

just wait for it not to be true,

who couldn’t do this, tell me who?

Do While

Here we get to another part, 

I really feel it with my heart,

now we can set an end,

for the WSQs of Ken.

condition will be true or false,

you just can’t make no faults.

The infinity of while is gone,

don’t get me with your gun.

#Mastery22

When to use what type of repetition in a program

What should you work on?

Week #12 and more partial exams for you.

For this week's readings:
C++ (TC1017) should either be looking at support for your project, ImageMagick C++ libraries are a good start.
Python (TC1014) should be finishing chapter 11 (Dictionaries).