There exist different kind of repetition that you can use in python; you can use loops (if, for or while) and recursion, I already explained them in my previous blogs. In this blog I am going to cover the subject of when using what kind of repetition. First the loops. You use the if loop …
Category Archives: Geen categorie
Recursion in Python
Till now, if I wanted to repeat things I always used if, while and for loops as explained in my previous blogs. But that is not the only way to repeat things, another solution is to use recursion while programming in Python. With recursion you are dividing the problem in smaller problems that will be …
Using for loop in Python
There are two different kind of loops in Python that you can distinguish. The first is the indefinite loop. That is the while loop, that I already explained in my previous blog. This is an indefinite loop, because it goes on till it meets the condition that is given in that loop. The other kind …
Using nesting in Python
In my previous blog, I explained a lot about using if, elif and else in Python. In this blog I am going further on that subject and we are going to use nesting in these conditions. Nesting is actually using conditions in conditions. We are going to use the code that we wrote in my …
Using conditions in Python
In this blog I am going to tell something about working with the conditions that Python has. There are three different conditions in Python: if, else and elif. I am going to explain them all by using them in a code. For exercise 1 that we previously made to calculate what the date of the …
Using modules in Python
Modules are useful to split your program/code in different files. In that way it becomes easier to use or adapt different parts separately.Just the definition of a module is a file that consist Python code. In this blog I am going to explain you the basic things about using modules while programming in Python. The …
Creating modules in Python
As I explained in the blog about using modules in Python, is it very practical to use modules in Python to edit separate parts of your code. Besides that gives it also a better overview in your script and I already explained in previous blogs how important a good overview over your code is. I …
Creating functions in Python
I am going to tell you some more about creating functions in Python in this blog. In the blog about calling functions of last week I already explained a little bit about making your own functions. In this blog I am coming back on that subject. User-defined functions are really nice to use, because you …
Calling already existing functions in Python
In this post I am going to explain how you need to use already existing functions in Python and I am going to demonstrate the use of them. This site gives a clear overview of all the built-in functions in Python that you can use with an explanation what the function does. So that is …
Basic user input Python
There are a couple of ways to gain input. First I am going to explain the easiest ways to gain input: The first one is just type: input() and run. In the command window/ shell is it then possible to type the input that you want. Click here to see what I did. Your input …