January 16

# Basic DataTypes

By Gulab Chand

January 16, 2020

• Every Variables in Python has a Datatype. In Python you do not need to declare any datatypes, you just write the variable and its value.
• Python automatically decide the types based on our value.
• Datatypes are created when you assign the value of variables.

Basic types:

Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  1.Â Numeric

Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  2. String

Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  Â  3. Boolean

### 1. PYTHON NUMERIC:

There are 3 types of Numeric.

• Integers
• Floating-point Numbers
• Complex Numbers

1. Integers:

When you declare numbers, it comes into the Integer datatypes.

2.Â Floating-point Numbers:

• Floating number is the decimal point numbers.
• Floating point number is up to 15 decimal places.
• E.g. Â  2 is integer, 2.5 is floating point number.

3. Complex Number:

â€‹

â€‹

• It is used when you have complex problem
• Its denoted by x + yj, where x and y are the real numbers and j is the imaginary unit.

2 . Python String:

â€‹

• String is the collection of characters.
• We can use single quotes( â€˜ ) or double quotes( â€œ ) for declaring string.
• We can use triple quotes ( â€˜ â€˜ â€˜ ) or ( â€œ â€œ â€œ ) for creating Multi-line strings.

3. Python Boolean:

â€‹

• It is used when we have binary value. It means either 0 or 1 and you can say Yes/No.
• Your answer is in between true and false or 0 and 1.

Gulab Chand