Logical Operators In previous article, I wrote about arithmetic operators.. in this article I will give you a list of logical operators that you will be using later on to add decision making capabilities in your programs. Yes .. that is correct your program will be able to make logical decisions and based on those decisions they do certain tasks. So lets prepare yourself, for how to write a code that makes a decision. Before we go and dig into logical operations, we need to learn this DataType which is called "Boolean" .. well you have different Datatypes in any programming language. Numbers Strings Dates and Booleans Boolean means, a value that is either True or False.. 0 or 1, you can think of it as a question whose answer is either Yes or No that's all what a boolean is. 1. OR , || Logical Operator It is used among two or more variables .. for to check whether one of the values is true .. if any single value is true among those values, result wil...
After learning basics of variables, I am sure now you have gained enough knowledge on how to store values inside of variables. Its time to play with variables and do some arithmetic operations on them. Addition , adding values together. my_age = 27 number_of_years = 3 total_age = my_age + number_of_years print "Total Age = " print total_age Subtraction , Removing value from a variable. my_age = 27 number_of_years = 3 total_age = my_age - number_of_years print "Total Age = " print total_age It is so lovely, how easily you can become older and younger :p by just adding and removing values in and out from your age .. Multiplication In this example, I am sharing with you, on how to multiply bitcoins it is very easy actually bitcoins = 0.2 multiplication_factor = 3 total_bitcoins = bitcoins * multiplication_factor print "Total Bitcoins = " print total_bitcoins * Operator is used to multiply two numbers together. more arithmetic ope...