Hello Friends, Welcome to our Website Python11. Today we will talk about Integers which is a subpart of Numbers.
To Understand this Blog You need to read our last post which is related to this topic which is as follows:-
2. Booleans.
To Understand this Blog You need to read our last post which is related to this topic which is as follows:-
Add caption |
Integers are whole numbers such as 5, 39, 1917, 0, etc. They have no fractional parts. Integers are represented in python by numeric values with no decimal point. Integers can be positive or negative, e.g., +12, -15, 3000 (missing + or - symbol means it is a positive number).
There are two types of Integers in Python :
- Integers (signed).
2. Booleans.
These represent the truth values False and True. The Boolean type is a subtype of plain integers, and Boolean values False and True behave like the values 0 and 1, respectively. To get the Boolean equivalent of 0 and 1, you can type bool(0) or bool(1), Python will return False or True respectively.
See the figure below (left side).
>>> bool(0) >>> str(False)
>>>False >>> 'False'
>>>bool(1) >>>str(True)
>>>True >>> 'True'
However, when you convert Boolean values False and True to a string, the strings 'False and 'True' are returned, respectively. The str( ) function converts a value to string.
So with this, we end with this Topic, don't forget to follow me so that you can get the latest updates of my new posts that I upload weekly, I will try my best to upload daily OR you can Sign up for Newsletters at the top of the Blog and that will give you E-mail updates of my New Post.
Jai Hind!!!!
Jai Hind!!!!
Vande Mataram!!!
No comments:
Post a Comment
If you have any doubts, please do let me Know.