Posts

Showing posts with the label Python Basics

Operators

*Types of Operators There are 7 python operators.  Arithmetic Operators Comparison (Relational) Operators Assignment Operators Logical Operators Bitwise Operators Membership Operators Identity Operators  **  Python Operators Precedence [more on operators] 1. Arithmetic Operators =>Types of arithmetic operators with description & example is tabulated below: Operator Description Example + Addition Addition of numbers. Simply adds numbers. 4+8=12 - Subtraction Subtracts right hand operand from left hand operand. 0 – 17 = -17 * Multiplication Multiplies values on either side of the operator 7 * 3 = 21 / Division Divides left hand operand by right hand operand 1/ 2= 0.5 % Modulus Divides left hand operand by right hand operand and returns remainder 5 % 2 = 1 ** Exponent Performs exponential (power) calculation on operators 10**2=100  // Floor Division - The division of operands whose result is the quotient in which the decimal point are r...

One line program

Image
One line is very important for learning a basic of programming language.  When programming beginners  are learning a new language, they must learn to write a one-line program that prints some of the message  "Hello world!" this is a simple program that shows either your computer is properly set up to run Python programs. Input: Output: