Python Basic@ Day1-Data Types

Python-Data Types

There are almost 14 data Types available in Python Data Types:

Everything in Python is considered is Object.



  1. Int type
  2. Float type
  3. Complex
  4. Bool type
  5. Str
  6. List
  7. Tupple-What is the differece between List & Tupple?
  8. Set
  9. Set Frozen
  10. Bytes
  11. ByteArray
  12. Range
  13. None
  14. dict

The most useful function in Python are of three types:
  • Type
  • id-Adress of the data
  • print
Int Data Types

  • It is the most important  data type which is written without using decimal.
    • However there is one more data type which is Long type for big numbers but it is only avilable in Python-2 not in Python-3 same ca be represented by int.
  • Sometimes it is also called as whole numbers too
  • The int type can be represented as four types:
    • Base 10-decimal
    • Base-2-Binary we have to write prefix oB prior to the number otherwise it would be consider as by default decimal.
    • Base-8-Octa
    • Base-16-Hexa 
      • Octal Form(Base-8)
        • Allowed number is from 0-7
        • 0o or0O always treated as octal number
        • a=0o123 print(a)
        • a=0o786 Syntax error as octal number is till 0-7 only
  • Hexadecimal Form(Base-16)
    • Allowed digits are 0-9 and A-F
    • A-10,B=11,C=12,D=13,E=14,F=15 (No case sensitive)
    • 0x or 0X hexadecimal number
  • In PVM(Python Virtual Machine) you will be always getting the umber in the decimal form irrespective of whatever form you are giving input
  • However to get output in the octal,binary,hexadecimal form we need base conversion function:
    • Base Conversion Function
      • bin()-----------ay other base to binary
      • oct()---------
      • hex()
  • All these base numbers are being applicable only if they are integral number.Default function is Decimal.








Comments

Popular posts from this blog

Top 5 Best Books For Python,Data Science & Machine Learning

How To Start A BLOG

Top 50 Most Innovative Companies in 2020

Blogger Tutorial

Normal Distribution

Descriptive Statistics

What is A Statistical Distribution?

Why Should We learn C Programming?

Introduction To Matplotlib-Python

Pandas-Python Tutorials