Pular para o conteúdo principal

Postagens

Mostrando postagens de 2021

Logic Programming With Python - 03

Control Flow We often need to run specific code for certain conditions or we must run a code snippet many times. Toward we have this behavors we need of structures of control flow. Basically these structures are divided into conditional and repeating structures.  Conditional structures allow select code snippets for specific conditions while Loop structures allow the execution of code snippets many times. Conditional structures in Python The logical conditionals usein Python are: Equals:  a == b Not Equals:  a != b Less than:  a < b Less than or equal to:  a <= b Greater than:  a > b Greater than or equal to:  a >= b These conditions are fundamental to statement logical and loops Simple if-statement. In this example were declared two variables: a and b. In the if-statement  was defined the condition b > a. As b is equal the five and a is equal to three the message "b greater than a" will show to the user. Code Block In Python, The code block is defined through

Logic Programming With Python - 02

  Basic concepts Some basic concepts are very important for learning programming. They are variables, mathematical operators, logical operators and loops. We will study these concepts through a practical approach using the Python language. Python is a general purpose programming language that has become very popular for being easy to learn and use, having several frameworks and libraries , being versatile, efficient, fast, flexible and having good support for machine learning. Our goal is not to deepen learning about Python. For more details on Python, visit the official language page https://www.python.org/ But we will use language Python to learning the basic concepts of Programming Logical Then, lets go To begin is need install the Python. We will go use the 3.x version. download You can use vim, notepad, notepad++ or any other text editor. To develop the code examples for this article Variables We can describe a variable as a part of memory where we store data to process or disp

Logic Programming With Python - 01

What is Programming Logic? The definition of Programming Logic depends on the conceptual understanding of the Algorithm . We can describe an algorithm as a set of steps to achieve a goal. Ex 01: What are the activities we need to do to go to work ? 1- wake up 2- take a shower 3- have a breakfast 4- take a car/bus or walk Ex 02: What are the steps needed to calculate the maximum load supported by a building? Ex 03: What are the steps needed to launch a rocket into space? In practice, we naturally apply the concept of algorithms to perform from the simplest to the most complex tasks. And the most important thing is to realize that if we follow these steps we will always achieve the same results considering an initial set of data. Like a cake recipe,  that is, if we have all the necessary ingredients with their respective quantities and we follow the recipe, the result will be the desired cake. Well, now I believe that we  can describe what is Programming Logic Programming Logic is a dis

Criando uma calculadora Android com o Kotlin

Resumo Aprender a programar para Android exige a absorção de conceitos básicos que são mais naturalmente entendidos quando aplicados em algum projeto de desenvolvimento. Objetivando introduzir o contato com o Kotlin para Android, foi criado neste artigo um aplicativo simples de calculadora que possibilita a apresentação do tratamento de eventos de botões, uso de expressões regulares e utilização de um método estático. Introdução O desenvolvimento de aplicativos envolve o entendimento de conceitos que devem ser naturalizados pelos desenvolvedores. Uma das formas mais comuns de se naturalizar os diversos recurso de uma plataforma é desenvolver projetos que demonstrem o funcionamento prático dos conceitos implementados. O aplicativo   Calculadora foi desenvolvido por possibilitar o contato inicial do desenvolvedor com os conceitos de tratamento de eventos, métodos estáticos e expressões regulares. O código desenvolvido buscou implementar estes conceitos de maneira introdutória. Não fo