Videos for relaxing

Most of the time, we manage very high stress levels, and we need to relax, here I show you some helps

Watch series

bimages.png

Series help you to relax and concentrate in other things

Watch something new, not just the classy

This really helps a lot, because you make yourself more open and know more about other cultures, I, for example, am starting to see korean doramas

45d7f1ccf1ee5adaf0160b2c12e63a1e.jpg

Surf in the Web

God, web is a really big ocean that is recomendable for you in stress moments, and it has from everything, not just procrastinating stuff also you can go into sites like Lynda or Coursera and learn new stuff

14682235441.jpg

What´s list?

Today I´m talking about lists, as I mention in a previous post, a list is a group of items that have a position. The syntax of the lists is like it follows:

name_of_the_list = [elements,elements]

The positions start at 0 and you call them like this

name_of_the_list [0]

Also you can modify them just calling the position and making it equal to the new value

list1[0]:  physics

or delete elements writing del before the position

del list1[2];

Also you´re able to do the basic operations

Python Expression Results Description
len([1, 2, 3]) 3 Length
[1, 2, 3] + [4, 5, 6] [1, 2, 3, 4, 5, 6] Concatenation
[‘Hi!’] * 4 [‘Hi!’, ‘Hi!’, ‘Hi!’, ‘Hi!’] Repetition
3 in [1, 2, 3] True Membership
for x in [1, 2, 3]: print x, 1 2 3 Iteration

or for more fun stuff check this:

https://www.tutorialspoint.com/python/python_lists.htm

I know that you know that I love you

Have you ever heard something like this? Well, in natural language is something common, and oh surprise, in programming also is. In programming we have something that is called recursive functions.

«Recursion is a method of programming or coding a problem, in which a function calls itself one or more times in its body. Usually, it is returning the return value of this function call. If a function definition satisfies the condition of recursion, we call this function a recursive function.

A recursive function has to fulfill an important condition to be used in a program: it has to terminate. A recursive function terminates, if with every recursive call the solution of the problem is downsized and moves towards a base case. A base case is a case, where the problem can be solved without further recursion. A recursion can end up in an infinite loop, if the base case is not met in the calls.»

Here is one example

This code throws the six first lines of the Pascal´s triangle:

pascal.PNG

References:

http://www.python-course.eu/python3_recursive_functions.php

So…you´re into this?

Nested loops ¿what are they? A nested loop is a loop within a loop, an inner loop within the body of an outer one. Is possible to realize this with all the different types of loops, with for´s, here is the basic structure:
nested_for_syntax

also with while’s

nested_while_syntax

with if else, and also combining them.

Here is one example of what you can do with nested loops:

nested.PNG

References:

https://www.tutorialspoint.com/python3/python_nested_loops.htm

http://tldp.org/LDP/abs/html/nestedloops.html

For

For

The flowchart of a for is like it follows:

for_1.PNG

This is the basic structure:

for_0.PNG

val is a certain value or ‘conditional’

Here is one example

for_2.PNG

for_3.PNG

Important information about for´s:

  • The for statement in Python has the ability to iterate over the items of any sequence, such as a list or a string.
  • If a sequence contains an expression list, it is evaluated first. Then, the first item in the sequence is assigned to the iterating variable iterating_var. Next, the statements block is executed. Each item in the list is assigned to iterating_var, and the statement(s) block is executed until the entire sequence is exhausted.

References:

http://www.programiz.com/python-programming

http://www.tutorialspoint.com/python3/

Fruit Loops the revenge

In this post I´ll explain the missing loops, those are: elif, while and for. So  let´s get started.

Elif

This is the flowchart of an elif

elif.jpg

this is how it works

elif.PNG

and here is one example

elif_1.jpg

Important information about elif:

  • The elif is short for else if.It allows us to check for multiple expressions.
  • If the condition for if is False, it checks the condition of the next elif block and so on.
  • If all the conditions are False, body of else is executed.
  • Only one block among the several if…elif…else blocks is executed according to the condition.
  • The if block can have only one else block. But it can have multiple elif blocks.

For

The flowchart of a for is like it follows:

for_1.PNG

This is the basic structure:

for_0.PNG

val is a certain value or ‘conditional’

Here is one example

for_2.PNG

for_3.PNG

Important information about for´s:

  • The for statement in Python has the ability to iterate over the items of any sequence, such as a list or a string.
  • If a sequence contains an expression list, it is evaluated first. Then, the first item in the sequence is assigned to the iterating variable iterating_var. Next, the statements block is executed. Each item in the list is assigned to iterating_var, and the statement(s) block is executed until the entire sequence is exhausted.

References:

http://www.programiz.com/python-programming

http://www.tutorialspoint.com/python3/