BASIC PYTHON DATA TYPES

 BASIC PYTHON DATA TYPES :


Strings :  Text("Hello")
Integers : Whole  numbers(20)
Floats : Decimal   numbers(3.14)
Booleans :   True  or False   values

Strings or Integers : 

numbers   in strings   between   double   quotes   or single   quotes   but   these   numbers   without   quotes   like   integers   and   preform  mathematical operations  .

example  :
string =  "123456"
Integers  123456  

Floats or Floating point Numbers : 

 Float is a numeric data type. numbers in decimal form that numbers are stored in float data type that handles numbers with decimal points . its perfect for precise calculation. 
In python , a float is a numeric data type 

examples : -3.14 , 0.0 , 3.14

Use float 
print(5+3.14)

output :
8.14

Boolean operators or ON or OFF in python :

you want to turn the light on or off using this switch . let represents the two possible states of the light.
  • True : represent light ON
  • False : represent light OFF
is_sunny =   False
is_cloudy   =   True

these are stored in Boolean data types



  • You have to must try in your python compiler use idle avoid online compilers to Errors



Post a Comment

0 Comments