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!
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: ...
As promised in the previous class, I present to you this lesson about variables. First we need to answer some questions. First, what’s a variable? The answer is: a variable is a space inside a memory, it save data and in programming languages, it also works for change the data inside it. Python is an high-level language, an high-level language is nearer of programmer, or human language like English for example. Python is simple! See below the variable declaration in languages like C, C++ or Java: This is the variable declaration structure, but in Python, we don’t need of this structure. So, declare the type isn’t required, but we need to initializer the variable. Below, see the variable declaration structure in Python: That’s enough, here we have the variable declaration in Python language. This structure is: variable_name = a_value, it can be a string too, or just a character. Test it in your interpreter, joyful! If you want to use other...
Comentários
Postar um comentário