Prepare for trouble! And make it double!

--Originally published at Programming Blog

Prepare for trouble and make it double!

Topics

  • Zen of Python
  • Use of loops with while
  • Importing and using modules/libraries
  • Use of conditional “if”
  • Use of conditional “else” (and elif)

 

This blog is made by Juan Montero and Daniel Arrieta #TC101

 

Zen of python

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one– and preferably only one –obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea — let’s do more of those!

 

First of all what is zen of python, it is recognized as how coding in python should be, since we don’t really understand we use it already, for example on the simple is better than complex, just as our last blogs that is just, print, or calling a function, etc.

whoa

This is our expression after knowing the Zen of python.

https://www.python.org/dev/peps/pep-0020/#id3

 

Use of loops with while

 

We already know the command while, but this comes a rather.. funny exception with loops, making it repeat until all the criterias are accomplished, let’s put it easier.

while-expression

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

So until the condition is satisfied it will keep running until it is realized,

while-coding
fuck-yourself
conditional-if
r-u-srs
elif-code
Continue reading "Prepare for trouble! And make it double!"

uoᴉʇɔunℲ ɐ ƃuᴉllɐƆ

--Originally published at Programming Blog

After having trouble with the title (start working that brain Guys!), we will be learning how to call a function.

And i learned that calling a function is like.. giving a variable the hole function (x=print(2+3))

Calling a function #1.png

We will require a statement called “def”.

And on the picture we have

def games (name=”doesn’t matter bla bla bla”)

and later on the code we can change what will games will be

Calling a function #2.png

Last but not least that’s how you can call a function, since everyone will be only looking on how to do it, go ask Ken and learn!


MOM!! GET THE CAMERA WE LEARNED SOMETHING NEW

--Originally published at Programming Blog

Hello dear #TC101 , in this post we will be learning a new function called “print”, which we already learned in Hello World, but we will be adding a comment on python you need to add the “#” + a tip of that line-code, as an example like in this pictureprint function bru

And basically that’s how you add a comment into your code.