The Range () function creates a list of variables for you to use, very common when working with “for” loops. There are two ways to create a range: Range (stop): this range starts with zero and ends with the number given as the stop value. Range ([start], stop [step]): you give the function the lower … Continue reading Creation and use of ranges
The user input allows you to get your program to interact with a living being, the user. This can be helpful when you desire to get a value you have no control over, for instance a variable. It can also be applied to quickly test a program with multiple values many times. To ask the … Continue reading Text based User input and Validation in Python
Both tuples and lists are bundles of data bound together under a single index. The difference radiates in both the syntax and the fact that the tuple is immutable, and the list can be altered. The difference in syntax between a list and a tuple is that to create a list you use “[ ]” … Continue reading Creation and use of Tuples and Lists in Python
So far we have seen both “while” and “for” loops, but now we will learn to judge in which situation we need to use either of them. The “while” loop will repeat itself as long as the condition that accompanies it remains true, this means that a “while” loop will tend to repeat itself to … Continue reading When to use which repetition
We have already seen how to do loops with “while”, and now we will learn how to use the “for” statement. The way you write a for is the following: “for i in x:”, after that you fill up its guts with what action you want it to perform. The “in” part makes it so … Continue reading For loops with “for”
Looping will be very important skill for this course, from my experience more that 75% of the activities you will do during the course will require you to loop a piece of code. There are different ways to make loops, but right now we will review the one called “While”. The while loop basically takes … Continue reading Loops with “While”
The nesting of a conditional statement works by writing an “If-else” inside another “if-else”, this way we can apply multiple conditions to a single value, having something similar to a filter with multiple layers. This is an important tool, but you should be very careful when writing a nested condition, since this can get very … Continue reading Nesting of conditional statements
Here you go, I made it in spanish beacause I feel far more comftable doing a recording in my first lenguaje.
#this is the only mastery with three topics since all of them relate to each other.# This three pals work together to make our life easier and just like the while they work with conditions. We use if, elif and else when we desire to perform different actions depending on the outcome of a … Continue reading “Triple kill”: If, Elif and Else
A good way to play around with python modules is using functions. In a previous mastery about the programing environment we already reviewed how to create a python file, and a module is just like that, but with the condition is that it has to be able to run by itself if given a parameter, … Continue reading Creating, Importing and Using Python modules