Postagens

Mostrando postagens de 2017

Course Python For Life 3 – Input Command

Imagem
As was promised in the previous lesson, now we’ll see the input command in python language, it’s a smaller lesson, next lesson, we’ll see variable’s concepts in Python that’s different of others languages. First step: - I recommend that you use the output command. In python, input command requires a variable. There’s two ways to use this command, they’re: - with print. - without print. Note: In python, you don’t need to use ‘;’ in the end of a line, it works, but it isn’t required. With print: print(‘type any key...’) a = input() Test it yourself! See it in the editor: Run and see what happen. It required that the use type any thing by the keyboard. Below, see it being ran. But there’s other way to do this code, see below: a = input(‘Press any key...’) Test it yourself! Think about it, that’s the way to learn! The appearance is:   ...

Course Python For Life 2

Imagem
Hello folks! Now I present to you the lesson 2 of Python Course. In this lesson, we’ll see the first steps and began to programming. Below, see a small introduction. Python is an interpreted programming language, what’s it? See below a definition. Literally defined, a language which is not compiled directly into machine code. Most Scripting Languages are Interpreted Languages, since they are executed directly from their textfile format, and no intermediate format is stored on disk. Source: http://wiki.c2.com/?InterpretedLanguage Now, let’s go to began coding. I use the default interpreter that’s available when you install Python in your computer, but you can use other softwares. Open your IDE and create a new file. See the image below. This is the file created. Now, let’s go to some important things. The input and output commands in Python language. Note: I’m using python3.6, as whole course will be done. In ...

Course C Initial 17th - Loop FOR Part 2

Imagem
Now, I have others notes about loop for. This command can be used like while, but it structure is different because the loop for use ‘;’. Below, see the basic structure of For command.   Between ‘;’, you put a condition and so, the command will work like a loop while. So, it works with this: a variable; a condition; a increment or decrement. The command FOR is a good tool that will be used many times. But if you ask to me: What’s the difference between this command and the command do while or while? My answer is that the command for is universal, but do-while is a special case that in others languages, there’s not, python is an example. FOR works with conditions too, but it allow to us, work with a limited possibility. Look at this image: The image give us it explanation. But I have a note: the last value of a is 11, but 11 isn’t large than 10, that’s the reason of the code stop. Below, see it being ran. The ...

Course C Initial 16th - Loop For Part 1

Imagem
As promised in previous lesson, I present for you the Loop For. It has something different of Do while or while. It works with a condition and increments. It structure is here below. Another words, the commands will be ran up to the condition be False, generally when the increment or decrement happens and the condition become False, else it repeat. You can use more than a condition in your code if you desire, it depends of context. Below see an example of a loop for.   In this case, it doesn’t run the code because 20 is larger than 0, 20>0. If you change it for ‘a>=0’, so the condition is true up to a=-1. Make yourself! As we can see, we can create a variable outside for, but we can create it inside for too. In this case, the variable called a is known in all main function. Outside, a is unknown. Note: if you create a variable inside for, ‘for(type variable=0; condition; increment or decre...

Course C Initial 15th – While

Imagem
Now, I present to you the While command. It’s similar to Do While command in the lesson 14. below, we can see the structure. Below, see a example about the While loop use and the print of it running . Write it in your compiler. But if the condition be false, the code inside while will not ran. See the next example and test in your compiler. Well, it’s the enough to use the While loop. Please make the  Challenges 14.1 using the Loop While learned in this lesson. In the next lesson, we’ll see the Loop FOR. Well, that’s all folks See you later!

Course C Initial 14.1 – Do While Challenges

Imagem
As I said in the previous lesson, Access Here , I have to you 5 challenges to you practice your ability. 1- Make an algorithm that ask to user type numbers, the stop condition is when was typed the Number 0, say to user the stop condition. 2- Make an algorithm that aks to user many numbers, use the stop condition, when the user type 0, so print the sum result at display. 3- Make an algorithm that ask to user type a number and so use a do while to decrement this number up to 0. print them at display. 4- Make an algorithm that ask to user a number, you’ll multiplies by its predecessor up it be 0. Print all the process. 5- Make an algorithm that as to user letter, user the variable different of space character as condition. In the next lesson, we’ll see the Command While. Share it with your friends! Well, that’s all folks! See you later!

Course C Initial 14th – Do While

Imagem
As promised in the last class, I present to you the Loop Do While. First, what’s a Loop? A loop is by definition a command that repeat a action inside code considering some situations. Access the  Lesson 2 to more information. Below, see the structure of Do While Command: In others words, we have ‘do’ or make this code, only in the end, it’ll tested, then can happen that the condition be false, but the code will be ran once. Now, see a example with Do While being ran. Below, see the code allow being ran. First the Do While command RUN, after it TEST, remember always! In the next lesson, I will do 5 challenges to you practice. Well, that’s all Folks! See you later!

Course C Initial 13rd – Loop Introduction

Imagem
Now I present to you a way that will easy our life. The loops! In others words, loop means repetition command. In C language we have tree loop types, they’re ‘do-while’, ‘while’ and ‘for’. What we’ll see is posts about them, and in the end of each post, we’ll make an activity to practice all knowledge. Well, that’s all folks and in the next lesson, we’ll see the ‘do-while’ command. So share with your friends. See you later folks!

Course C Initial 12nd – Exercises with Switch

Imagem
Now, do these Algorithms using switch command. 1- Make an algorithm that works as a game, it may ask to user “What’s United Kingdom Capital?” so the user will have available 4 possibility, they’re respectively a) Manchester, b) Newcastle, c) London, d) Liverpool, after will be tested them. Note: use for store the result, a character type variable. Case ‘c’, so printf (“You’re Wright”); default, so printf (“You’re wrong”); 2- Make an algorithm that reserves the product code and the quantity, so calculate the prices. Note: before defines how you can see below: ‘ M’ – Milk – U$ 1,00 1L. ‘ P’ – Potato – U$ 2,50 Kg. ‘ E’ – Meat – U$ 10,00 Kg. ‘ J’ – Juice – U$ 0,50 each. Use switch structure, for invalid values, use default to show a note at display. After multiple the price by quantity and print the total price. 3- Make an algorithm that works how a calculator. Use a char variable to store the operator and so make the operation and show...

Course C Initial 11st – Switch Commands

Imagem
Switch is other way to selections commands, it test a variable integer or character, (it cans not use a float or double for example), with cases. See below its structure: Read the image. A switch command is use when we have a finite number of possibilities. In C, we can use switch how many time we desire. Other point is which switch allows breaks in the code. So see below breaks being running. As we can see, the case can use with breaks, since 1 to 7 for example. But it’s limited. Note: in Switch Command, we can’t test conditions as in if-else, so the form case 2<4 is invalid to switch. In case, never forget to put break; it’s the signal to the compiler that what’s inside case, had finished. In default, it’s not required. Now, see an alternative structure to switch command: That works, but it isn’t required. So I prefer use the previous way. Note: Switch and If Else can be interconnected, but be careful with this. I...

Download: IF-Else Algorithms

Imagem
Here is the algorithms that is asked in  Lesson 10 About If-Else command. So, if you wish, you can make downloads of each question in Lesson 10. Question 1 Question 2 Question 3 Question 4 Question 5 Question 6 Question 7 Question 8 Question 9 Question 10 Note: if you use windows, you can include <stdlib.h> to use ‘system(“pause”);’, with this, you can pause the run up to user push enter. Well, that’s all Folks! See You Later!

NEWEST: Page to make Downloads

Imagem
I present for you a page to make download of algorithms. So, every time that be possible, will posted algorithms to you do download and practice. Well, that's all folks! See you later!

Course Python for Life 1

Imagem
Hello people! I present for you the newest course. Its name is Python For Life. This course will help you to learn this programming language. So, in this introduction, I’ll show to you some things about the language and in the next lesson, we’ll work with it. Now, a resume about Python programming language history. Python is a widely used high-level programming language for general-purpose programming , created by Guido van Rossum and first released in 1991. An interpreted language , Python has a design philosophy that emphasizes code readability (notably using white space indentation to delimit code blocks rather than curly brackets or keywords), and a syntax that allows programmers to express concepts in fewer lines of code than might be used in languages such as C++ or Java . The language provides constructs intended to enable writing clear programs on both a small and large scale. Python was conceived in the late 1980s, and its implementation began in ...

NEWEST!! Presentation – Course Python

Imagem
Is with a great honor that I present the newest course in this blog. Now we’ll study the Python programming language. With this course, you’ll have new horizons and possibilities, so share this newest with your friends and follow us by e-mail for reserves the newest. Subscribe us if you desire. So, see you later to study python language.

Course C Initial 10th – Exercises with If-Else

Imagem
Lesson 10. As we see in the previous lesson, now we’ll make some algorithms to practice. Those are 10 questions. I recommend that you make this algorithms because it’ll help you in the future. 1- Make an algorithm that reserves how tall is a person and test this conditions: If the Tall is greater than 1.90, printf (“You can play basketball”); If the Tall is smaller than 1.50, printf (“You’re not taller”); if the Tall is greater or equal to 1.50 and smaller or equal than 1.90, printf (“You’re between arrive”); 2- Make an algorithm that works as a game, it may ask to user “What’s the Spanish Capital?” so the user will have available 4 possibility, they’re respectively a) Madrid, b) Barcelona, c) Vigo, d) Sevilla, after will be tested them. Note: use for store the result, a character type variable. If the variable is equal to ‘a’, so printf (“You’re Wright”); Else, so printf (“You’re wrong”); 3- Make an algorithm that works as a table,...