Blog

python tutorials and learn python

Created with Sketch.

Python Float to Int

Python Float to Int Summary: in this tutorial, you’ll learn how to convert a float to an integer. Suppose that you have a float such as 20.3, and you want to convert it to an integer. When you convert a float to an integer, you’ll have a data loss. For example, 20.3 may become 20…
Read more

Python float

Python float Summary: in this tutorial, you’ll learn about the Python float type, how Python represents floating-point numbers, and how to test the floating-point number for equality. Introduction to the Python float type Python uses the float class to represent real numbers. CPython implements float using C double type. The C double type usually implements…
Read more

Python or Operator

Python or Operator Summary: in this tutorial, you’ll learn about the Python or operator and how to use it effectively. Introduction to the Python or operator The or the operator is a logical operator. Typically, you use the or operator to combine two Boolean expressions and return a Boolean value. The or the operator returns…
Read more

Python and Operator

Python and Operator Summary: in this tutorial, you’ll learn about the Python and logical operator and how to use it to control the flow of code. Introduction to the Python and operator The Python and operator is a logical operator. Typically, you use the and operator to operate on Boolean values and return a Boolean…
Read more

Python bool

Python bool Summary: in this tutorial, you’ll have a deep understanding of the Python bool class and how to handle boolean values effectively. Introduction to the Python bool class To represent boolean values including True and False, Python uses the built-in bool class. The bool class is the subclass of the int class. It means…
Read more

Python Modulo

Python Modulo Summary: in this tutorial, you’ll learn about the Python modulo operator (%) and how to use it effectively. Introduction to the Python modulo operator Python uses the percent sign (%) as the modulo operator. The modulo operator always satisfies the following equation: N = D * ( N // D) + (N %…
Read more

Python Floor Division

Python Floor Division Summary: in this tutorial, you’ll learn about Python floor division operator (//) or mod. Introduction to Python floor division Suppose you have a division of two integers: 101 / 4   In this division, 101 is called a numerator (N) and 4 is called a denominator (D). The integer division 101 /…
Read more

Python Integers

Python Integers Summary: in this tutorial, you’ll learn about Python integers and how Python stores integers in the memory. Integers are whole numbers that include negative numbers, zero, and positive numbers such as -3, -2, -1, 0, 1, 2, 3. Python uses the class int to represent all integer numbers. All integers are objects. How…
Read more

Python None

Python None Summary: in this tutorial, you’ll learn about Python None and how to use it properly in your code. Introduction to the Python None value In Python, None is a special object of the NoneType class. To use the None value, you specify the None as follows: None Code language: Python (python) If you…
Read more

Python is operator

Python is operator Summary: in this tutorial, you’ll learn about the Python is operator and the differences between the is operator and equality (==) operators. Introduction to Python is the operator Python is the operator compares two variables and returns True if they reference the same object. If the two variables reference different objects, the…
Read more