Repository navigation
Expand file tree
/
Copy path007-Boolean-Data-Type.py
More file actions
61 lines (50 loc) · 2.48 KB
/
Copy path007-Boolean-Data-Type.py
File metadata and controls
61 lines (50 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
"""
===============================================================================
Boolean Data Type
===============================================================================
Program Description:
--------------------
This program demonstrates the Boolean (bool) data type in Python.
A Boolean data type represents one of two possible values:
1. True
2. False
Boolean values are commonly used in decision-making statements such as
if, if-else, while loops, and logical operations.
Author : Shaik Mahaboob Basha
Repository : 13-Python
File Name : 07-Boolean-Data-Type.py
===============================================================================
"""
# -----------------------------------------------------------------------------
# Creating a Boolean variable named status1.
# The variable stores the Boolean value True.
# -----------------------------------------------------------------------------
status1 = True
# status1 contains the Boolean value True.
# -----------------------------------------------------------------------------
# Creating a Boolean variable named status2.
# The variable stores the Boolean value False.
# -----------------------------------------------------------------------------
status2 = False
# status2 contains the Boolean value False.
# -----------------------------------------------------------------------------
# Displaying the value stored in status1.
# -----------------------------------------------------------------------------
print("Value of status1 :", status1)
# Output: Value of status1 : True
# -----------------------------------------------------------------------------
# Displaying the value stored in status2.
# -----------------------------------------------------------------------------
print("Value of status2 :", status2)
# Output: Value of status2 : False
# -----------------------------------------------------------------------------
# Displaying the data type of status1.
# type() is a built-in function used to identify the data type of a variable.
# -----------------------------------------------------------------------------
print("Data Type of status1 :", type(status1))
# Output: Data Type of status1 : <class 'bool'>
# -----------------------------------------------------------------------------
# Displaying the data type of status2.
# -----------------------------------------------------------------------------
print("Data Type of status2 :", type(status2))
# Output: Data Type of status2 : <class 'bool'>