Posts

Testing in Python and types of software testing

  Software testing Software testing is a most often used technique for verifying and validating the quality of software . Software testing is the procedure of executing a program or system with the intent of finding faults. Software testing is a significant activity of the software development life cycle (SDLC). It helps in developing the confidence of a developer that a program does what it is intended to do so.  White-box testing (also known as clear box testing, glass box testing, transparent box testing, and structural testing) is a method of testing software that tests internal structures or workings of an application, as opposed to its functionality. Black-box testing is a method of software testing that examines the functionality of an application without peering into its internal structures or workings. Debugger PuDB 2017.1.1 for unix and mac osx A full-screen, console-based Python debugger PuDB is a full-screen, console-based visual debugger for Python. Its goal is to...

DataTypes in Python

DataTypes in Python   str (T) -> str returns string showing literal (possible signed for numeric types) int (T) -> int returns 0 for False, 1 for True; truncated float; truncated real–part of complex float (T) -> float returns 0.0 for False, 1.0 for True; equivalent for int; real–part for complex complex (T) -> complex returns (0+0j) for False, (1+0j) for True; equivalent int and float bool (T) -> bool False for empty string and zero value, True for non–empty string and non–zero value Examples of operators a%b = a - b*(a//b)  bool('False') =True 12//5 is same as math.floor(12/5) math.floor(-1.5)=?? int(-1.5)=?? print('Hitesh','Vataliya')=?? print('Hitesh'+'Vataliya')=?? print(5*'Hitesh')

Assignment Operators

 Python Assignment Operators:  Assume a = 10 and b = 20 then: = Simple assignment operator, Assigns values from right side operands to left side operand: c = a + b will assign value of a + b into c += Add AND assignment operator, It adds right operand to the left operand and assign the result to left operand: c += a is equivalent to c = c + a -= Subtract AND assignment operator, It subtracts right operand from the left operand and assign the result to left operand c -= a is equivalent to c = c - a *= Multiply AND assignment operator, It multiplies right operand with the left operand and assign the result to left operand c *= a is equivalent to c = c * a /= Divide AND assignment operator, It divides left operand with the right                     operand and assign the result to left operand c /= a is equivalent to c = c / a %=           Modul...

Python Logical Operators

  Python Logical Operators:  There are following logical operators supported by Python language  Assume variable a = 10 and  b =  20 then: and Called Logical AND operator. If both the operands are true then then condition becomes true. (a and b) is true. or Called Logical OR Operator. If any of the two operands are non zero then then condition becomes true. (a or b) is true. not Called Logical NOT Operator. Use to reverses the logical state of its operand. If a condition is true then Logical NOT operator will make false.

Comparison Operator in Python

 Python Comparison Operators:  Assume a = 10 and b = 20 then: == Checks if the value of two operands are equal or not, if yes then condition becomes true. (a == b) is not true. != Checks if the value of two operands are equal or not, if values are not equal then condition becomes true. (a != b) is true. > Checks if the value of left operand is greater than the value of right operand, if yes then condition becomes true. (a > b) is not true. < Checks if the value of left operand is less than the value of right operand, if yes then condition becomes true. (a < b) is true. >= Checks if the value of left operand is greater than or equal to the value of right operand, if yes then condition becomes true. (a >= b) is not true. <= Checks if the value of left operand is less than or equal to the value of right operand, if yes then condition becomes true. (a <= b) is true.

Arithmetic operators in Python

 Python Arithmetic Operators:  Assume a = 10 and b = 20 + Addition - Adds values on either side of the operator:  a + b will give 30 - Subtraction - Subtracts right hand operand from left hand operand: a - b will give -10 * Multiplication - Multiplies values on either side of the operator: a * b will give 200 / Division - Divides left hand operand by right hand operand: b / a will give 2 % Modulus - Divides left hand operand by right hand operand and returns remainder:   b % a will give 0 ** Exponent - Performs exponential (power) calculation on operators: a**b will give 10 to                          the power 20 // Floor Division - The division of operands where the result is the quotient in which the                     digits after the decimal point are removed. 9//2 is equal to 4 a...

What is an operator in Python? How many types of operators?

 What is an operator? Operator is symbol used to perform some operation on data values. For Example 4 + 5 is equal to 9. Here 4 and 5 are called operands and + is called operator.  Python language supports following type of operators. Arithmetic Operators Comparision Operators Logical (or Relational) Operators Assignment Operators Conditional (or ternary) Operators