PythonNote 05.drawio
PythonNote 05.drawio
a= 10
b=0o10
c=0X10
d=0B10
print(a) 10
print(b) 8
print(c) 16
print(d)2
Python - Class 04( Python)
Date: 18th June 2024
By - Shyam Singh
We can use float data type to represent floating point values(decimal values)
e.g. f = 1.234
type(f) float
We can also represent floating point values by using exponential form (Scientific Notation)
e.g. f = 1.2e3 -> instead of 'e' we can use 'E'
The main advantage of exponential form is we can represent big values in less memory.
We can represent int values in decimal , binary, octal and hexa decimal forms. But we can
represent float values only by using decimal form.
We can use this data type to represent Boolean values.
The Only allowed values for this data type are : True and false.
bool Data Type
In the real part if we use int values then we can specify that either by
decimal,octal,binary or hexa decimal form.