What is a Numeric Data Type in Python | EP-28 Numeric Data Types in Python | Python Data Types

Subscribers:
27,900
Published on ● Video Link: https://www.youtube.com/watch?v=F8KxaPewl9o



Duration: 0:00
53 views
0


NUMERIC DATATYPE
"""In Python, “Numberic datatype” is a category that has different types of numeric data.
Python supports various types of numbers, including integers, floating-point numbers, and complex numbers.
Table of Content

Python Integer
Python Float
Python Complex
Type Conversion in Python
Decimal Numbers in Python"""
1.Python Integer
"""
Python int is the whole number, including negative numbers but not fractions.
In Python, there is no limit to how long an integer value can be."""

Creating int and checking type
num = -8

print the data type
print(type(num))

Performing arithmetic Operations on int type
a = 5
b = 6

Addition
c = a + b
print("Addition:",c)

d = 9
e = 6

Subtraction
f = d - e
print("Subtraction:",f)

g = 8
h = 2

Division
i = g // h
print("Division:",i)

j = 3
k = 5

Multiplication
l = j * k
print("Multiplication:",l)

m = 25
n = 5

Modulus
o = m % n

print("Modulus:",o)

p = 6
q = 2

Exponent
r = p ** q
print("Exponent:",r)

2. Python Float
"""
This is a real number with a floating-point representation. It is specified by a decimal point.
Optionally, the character e or E followed by a positive or negative integer may be appended to specify
scientific notation. . Some examples of numbers that are represented as floats are 0.5 and -7.823457.

They can be created directly by entering a number with a decimal point, or by using operations such as
division on integers. Extra zeros present at the number’s end are ignored automatically."""

Creating float and checking type


num = 3/4
print the data type
print(type(num),num)

"""As we have seen, dividing any two integers produces a float. A float is also produced by running an
operation on two floats, or a float and an integer."""
num = 6 * 7.0

print(type(num))

Performing arithmetic Operations on the float type


a = 5.5
b = 3.2

Addition
c = a + b
print("Addition:", c)

Subtraction
c = a-b
print("Subtraction:", c)

Division
c = a/b
print("Division:", c)

Multiplication
c = a*b

print("Multiplication:", c)

"""Note : The accuracy of a floating-point number is only up to 15 decimal places, the 16th place can be inaccurate."""

#PythonTutorial #PythonDataTypes #NumericDataTypes #LearnPython #PythonForBeginners #PythonCoding #DataTypesInPython #PythonProgramming #CodingForBeginners #PythonSeries #python #coding #programming #datascience #learntocode #pythontips




Other Videos By Cybrosys Technologies


2024-08-22Inside Cybrosys | A Glimpse into Our World | Best IT Company in Calicut, Kochi | Best Odoo Company
2024-08-21How to Make Sure One2Many Records Are Deleted When the Parent Record Deleted in Odoo 17
2024-08-21Closing Entry by Product in Odoo 18 POS | Closing Entry by Product in Odoo 18 Point of Sale |Odoo 18
2024-08-21Revamped POS User Interface in Odoo 18 | Odoo 18 Revamped Point of Sale User Interface | Odoo 18 POS
2024-08-20How to Check if a Number is Even or Odd in Python| EP-30 Check Given Number is Even or Odd in Python
2024-08-20Odoo 18 Events PWA | Registration Desk Kiosk | Event Kiosk Mode in Odoo 18 | Odoo 18 New Features
2024-08-20How to Create Event Stages in Odoo 17 Events App | How to Manage Event Stages in Odoo 17 Events App
2024-08-19What is Boolean Data Type in Python | EP-29 Boolean Datatype in Python | Python Booleans| Data Types
2024-08-19Odoo 18 Marketing Card App | New App in Odoo 18 | Marketing Card in Odoo 18 | Odoo 18 New Features
2024-08-19How to Manage Your Company Budget Using Odoo 17 Accounting | Budget Management in Odoo 17 Accounting
2024-08-18What is a Numeric Data Type in Python | EP-28 Numeric Data Types in Python | Python Data Types
2024-08-15Quoted Search for Exact Match in Odoo 18 | Odoo 18 New Features | Odoo 18 Expected Features |Odoo 18
2024-08-15How to Format String in Python | EP-27 String Formatting in Python | Python Tutorials
2024-08-15How to Create Maintenance Request in Odoo 17 | Odoo 17 Maintenance App |Odoo 17 Functional Tutorials
2024-08-13How to Create a Helpdesk Ticket in Odoo 17 | Odoo 17 Help Desk App | Odoo 17 Functional Tutorials
2024-08-13Odoo 18 Attendance Kiosk | Odoo 18 Attendance PWA | Odoo 18 New Features | Odoo 18 Tutorials
2024-08-12How to Configure Task Management in Odoo 17 Field Service | How to Manage Task Creation in Odoo 17
2024-08-12New Employee Login Screen in Odoo 18 POS | Odoo 18 Point of Sale | Odoo 18 New Features | Odoo 18
2024-08-11Bank Account Menu in Odoo 18 Employee App | Odoo 18 New Features | Latest Features in Odoo 18
2024-08-11How to Create Worksheet Template in Odoo 17 Field Service | Customize Worksheet in Odoo 17
2024-08-08How to Capitalize Each String in a List of Strings in Python | EP-26 String Capitalize() Method